Math Fundamentals18 sections · 814 units
Open in Course

Problem - Fizz Buzz

LeetCode 412

Given an integer nn, return an array where each element follows these rules:

∙\bullet If ii is divisible by both 33 and 55, output "FizzBuzz"

∙\bullet If ii is divisible by 33, output "Fizz"

∙\bullet If ii is divisible by 55, output "Buzz"

∙\bullet Otherwise, output the number as a string