Skip to content

williamgregorio/FizzBuzz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

FizzBuzz

FizzBuzz function Given an integer n, return a string array answer (1-indexed) where:

answer[i] == "FizzBuzz" if i is divisible by 3 and 5.
answer[i] == "Fizz" if i is divisible by 3.
answer[i] == "Buzz" if i is divisible by 5.
answer[i] == i (as a string) if none of the above conditions are true.

Input: n = 3 Output: ["1","2","Fizz"]

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"]

CONSTRAINTS: 1 <= n <= 104

About

FizzBuzz function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published