← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Write a function that returns a list of strings representing numbers from 1 to n.
Classic rules: For multiples of 3, output "Fizz"; for multiples of 5, output "Buzz"; and for multiples of both, output "FizzBuzz".
Extension: Accept a map of rules where keys are divisors and values are the strings to output. For numbers divisible by multiple keys, concatenate the strings in order of the divisors.