0412. Fizz Buzz
https://leetcode.com/problems/fizz-buzz
Description
Given an integer n
, return a string array answer
(1-indexed) where:
answer[i] == "FizzBuzz"
ifi
is divisible by3
and5
.answer[i] == "Fizz"
ifi
is divisible by3
.answer[i] == "Buzz"
ifi
is divisible by5
.answer[i] == i
if non of the above conditions are true.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= n <= 104
ac
Last updated