Last active
June 15, 2016 19:50
-
-
Save lsantos/b4355f8d34966f4330583d46b39ff77d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(1..100).map do |n| | |
if n % 15 == 0 | |
"FizzBuzz" | |
elsif n % 3 == 0 | |
"Fizz" | |
elsif n % 5 == 0 | |
"Buzz" | |
else | |
"x" | |
end | |
end.group_by {|d| d }.each { |k,v| p "#{k} has #{v.size} occurrences"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment