Signal Filter (FizzBuzz)

Medium
#logic #interview

Input: `n` (int). Return: List of strings 1 to n. Replace multiples of 3 with 'Fizz', 5 with 'Buzz', both with 'FizzBuzz'. A classic interview filter.

Example

Input: 5
Output: ['1', '2', 'Fizz', '4', 'Buzz']
Need a hint?
  • Check % 15 first, then % 3 and % 5
Run your code to see output