78: Fizz buzz

Given an integer value, return a string representation of numbers from 1 to value

Rules:

  • for multiples of 3 return Fizz
  • for multiples of 5 return Buzz
  • for multiples of 3 and 5 return FizzBuzz
  • otherwise, return number

 

Example 1

Input:  3

Output: ["1" , "2", "Fizz"]

Example 2

Input:  5

Output: ["1" , "2", "Fizz", "4" , "Buzz"]
Difficulty:Easy
Topic:Array
Problem #:78