← All problemsSign in to save submissions
FizzBuzzeasy
Given an integer n, return an array answer (1-indexed) where:
answer[i] = "FizzBuzz"ifiis divisible by 3 and 5answer[i] = "Fizz"ifiis divisible by 3answer[i] = "Buzz"ifiis divisible by 5answer[i] = i(as a string) otherwise
Example
Input: n = 5
Output: ["1","2","Fizz","4","Buzz"]
Run your code to see test results.