As reported: DocuSign software engineering intern online assessment (April 2025), question 1 of 3: FizzBuzz.
This is LeetCode 412 — Fizz Buzz.
Given an integer n, return a string array answer (1-indexed) where:
answer[i] == "FizzBuzz"ifiis divisible by 3 and 5,answer[i] == "Fizz"ifiis divisible by 3,answer[i] == "Buzz"ifiis divisible by 5,answer[i] == i(as a string) otherwise.
Example 1
n = 3 -> ["1","2","Fizz"]
Example 2
n = 5 -> ["1","2","Fizz","4","Buzz"]
Example 3
n = 15 -> ["1","2","Fizz","4","Buzz","Fizz","7","8","Fizz","Buzz","11","Fizz","13","14","FizzBuzz"]
Constraints: 1 ≤ n ≤ 10^4.
Code runner format: one line holding n. Implement fizzBuzz(n); the harness prints the array.