PUZZLE TIME how would you implement in ruby a method that takes ["a", "b", "a", "c", "c"] and returns {"a" => 2, "b" => 1, "c" => 2} ?
-
-
Replying to @Carols10cents
@Carols10cents h = http://Hash.new (0); a.each{|l| h[l] += 1}; h2 replies 1 retweet 0 likes -
-
Replying to @Carols10cents
@Carols10cents you would not believe how much rust syntax I wrote trying to write this. You might2 replies 0 retweets 1 like
Replying to @steveklabnik
@steveklabnik oh i would believe it. i keep trying to use match in ruby
6:08 PM - 6 Aug 2015
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.