4 ms·
I've tried overthinking FizzBuzz myself, but from the architectural point of view: https://medium.com/@sbichenko/the-wrong-fizzbuzz-81cb8e67ef4a https://medium.
by exizt88 11y ago
I've tried overthinking FizzBuzz myself, but from the architectural point of view: https://medium.com/@sbichenko/the-wrong-fizzbuzz-81cb8e67ef4a https://medium.com/@sbichenko/the-wrong-fizzbuzz-81cb8e67ef4...
- kazagistar 11y agoI agree that string concatenation is the optimal solution and always take the chance to bring out a properly generic solution. let fbg s l u=unlines[case concat[w|(w,c)<-s,mod i c==0]of[]->show i;m->m|i<-[l..u]] let fizzbuzz = fbg [("Fizz",3),("Buzz",5)] 1 100 main = putStrLn fizzbuzz