n, with a twist:
- a number divisible by both 3 and 5 is replaced by "FizzBuzz";
- a number divisible only by 3 is replaced by "Fizz";
- a number divisible only by 5 is replaced by "Buzz";
- any other number is said as is (as a string, e.g. "7").
Return the list of n strings spoken during the game, in order.n=6 → ['1', '2', 'Fizz', '4', 'Buzz', 'Fizz']
3 and 6 are multiples of 3 ("Fizz"), 5 is a multiple of 5 ("Buzz"), the rest are said as numbers.
n=15 → ['1', '2', 'Fizz', '4', 'Buzz', 'Fizz', '7', '8', 'Fizz', 'Buzz', '11', 'Fizz', '13', '14', 'FizzBuzz']
15 is a multiple of both 3 and 5, so the last player says "FizzBuzz".
n=1 → ['1']
n=6
['1', '2', 'Fizz', '4', 'Buzz', 'Fizz']
Run checks the first 3 tests in your browser. Submit checks all 47 tests on the server, hidden ones included.