fork download
  1. def word_stats(text)
  2. text.split(" ").group_by{|e| text(e) += 1}
  3. end
  4.  
  5. p word_stats("We'll see who has the last laugh")
Runtime error #stdin #stdout #stderr 0.05s 9696KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:2: syntax error, unexpected tOP_ASGN, expecting '}'
	text.split(" ").group_by{|e| text(e) += 1}
	                                       ^