My favorite FizzBuzz solution is actually:
``` ->(n){[[["Fizz"][n%3],["Buzz"][n%5]].join].find(->{n}){|w| w if !w.empty?}} ```
This is Ruby, of course, probably something very similar can be done in several other languages.
My favorite FizzBuzz solution is actually:
``` ->(n){[[["Fizz"][n%3],["Buzz"][n%5]].join].find(->{n}){|w| w if !w.empty?}} ```
This is Ruby, of course, probably something very similar can be done in several other languages.