fork download
  1. def vowelhistagram(string)
  2. string.each_char.with_object(Hash.new(0)) {
  3. |obj, hsh| hsh[obj] += 1 if obj =~ /[aeiou]/i || obj.count == 0
  4. }
  5. end
  6.  
  7. print vowelhistagram("Alright well lets see if this works")
Runtime error #stdin #stdout #stderr 0.05s 9664KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:3:in `count': wrong number of arguments (0 for 1+) (ArgumentError)
	from prog.rb:3:in `block in vowelhistagram'
	from prog.rb:2:in `each_char'
	from prog.rb:2:in `with_object'
	from prog.rb:2:in `vowelhistagram'
	from prog.rb:7:in `<main>'