CodeEval: Fizz Buzz (Java)

Finally managed to get some spare time in order to do this. Helped be clear my head a bit. Here’s my quick 1 minute solution to CodeEval’s fizz buzz problem in Java:

Upon submitting, CodeEval marked my solution as unique (go figure!) which was a bit weird. However, I thought I could do better. So, here’s a second approach using lambdas:

This takes slightly longer (3-5 ms) and uses more memory.

Leave a Reply

Your email address will not be published. Required fields are marked *