2 ms·
I 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 c
by kazagistar 11y ago
I 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