Initializing model...

FizzBuzz

easy

Given an integer `n`, return a list of strings where for each number from 1 to n:

- If the number is divisible by 3, the string is `"Fizz"`

- If divisible by 5, the string is `"Buzz"`

- If divisible by both 3 and 5, the string is `"FizzBuzz"`

- Otherwise, the string is the number itself

Function Signature

def fizzbuzz(n: int) -> list[str]:

Examples

Input: n = 5
Output: ["1", "2", "Fizz", "4", "Buzz"]
Input: n = 15
Output: ["1", "2", "Fizz", "4", "Buzz", "Fizz", "7", "8", "Fizz", "Buzz", "11", "Fizz", "13", "14", "FizzBuzz"]