Fizz Buzz
Given an integer n, return a string array answer (1-indexed) where:
answer[i] == "FizzBuzz"ifiis divisible by3and5.answer[i] == "Fizz"ifiis divisible by3.answer[i] == "Buzz"ifiis divisible by5.answer[i] == i(as a string) if none of the above conditions are true.
Example 1
Input
n = 3Output
["1","2","Fizz"]For numbers 1 through 3, only 3 is divisible by 3, so it is replaced with "Fizz".
Example 2
Input
n = 5Output
["1","2","Fizz","4","Buzz"]For numbers 1 through 5, 3 becomes "Fizz" and 5 becomes "Buzz".
Constraints
- 1 <= n <= 10^4