def vowelhistagram(string) string.each_char.with_object(Hash.new(0)) { |obj, hsh| hsh[obj] += 1 if obj =~ /[aeiou]/i || obj.count == 0 } end print vowelhistagram("Alright well lets see if this works")
Standard input is empty
Standard output is empty
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>'