Tap here to switch tabs
Problem
Submissions

Problem: Fizz Buzz

Fizz Buzz asks you to build a string array for the numbers from one through n, using "Fizz" for multiples of three, "Buzz" for five, "FizzBuzz" for both, and each number otherwise.

Statement

Given an integer n, return a string array answer where answer[i] is the string representation of the integer i + 1 for each i from 00 to n - 1, except:

If i + 1 is divisible by both 33 and 55, answer[i] should be "FizzBuzz".
If i + 1 is divisible by 33 but not $5, answer[i] should be "Fizz".
If i + 1 is divisible by 55 but not $3, answer[i] should be "Buzz".

Return answer.

Constraints:

  • 1≤1 \leq n ≤104\leq 10^4

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Fizz Buzz

Fizz Buzz asks you to build a string array for the numbers from one through n, using "Fizz" for multiples of three, "Buzz" for five, "FizzBuzz" for both, and each number otherwise.

Statement

Given an integer n, return a string array answer where answer[i] is the string representation of the integer i + 1 for each i from 00 to n - 1, except:

If i + 1 is divisible by both 33 and 55, answer[i] should be "FizzBuzz".
If i + 1 is divisible by 33 but not $5, answer[i] should be "Fizz".
If i + 1 is divisible by 55 but not $3, answer[i] should be "Buzz".

Return answer.

Constraints:

  • 1≤1 \leq n ≤104\leq 10^4