Menu
CoddyTech

FizzBuzz

In the counting game FizzBuzz, players count up from 1 and replace some numbers with words. Given a turn number n, return what a player says on that turn: "FizzBuzz" if n is divisible by both 3 and 5, "Fizz" if it is divisible by 3 only, "Buzz" if it is divisible by 5 only, and otherwise n itself written as a string, such as "7".

Function

fizzBuzz(n: integer) → string
ninteger
the turn number, a positive integer
Returnsstring
the word or number said on turn n, as a string

Constraints

  • 1 ≤ n ≤ 109
  • The answer is always a string, even when it is the number itself.

Examples

Input
n = 15
Output
"FizzBuzz"
Explanation
15 divided by 3 is 5 and 15 divided by 5 is 3, both with no remainder, so turn 15 is "FizzBuzz".
challenge icon

Follow-up

A new rule makes multiples of 7 "Bazz", words joined in order, so 105 is "FizzBuzzBazz". How do you add it without a case for every combination?

Reset code
def fizzBuzz(n):
    # Write code here

Test #1

Test #2

Argument

n = 15

Expected Output

"FizzBuzz"