Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 601 Bytes

File metadata and controls

17 lines (11 loc) · 601 Bytes

FizzBuzz

Instructions

Given positive integer n implement a function which returns an array numbers from 1 to n. However for multiples of three list should contain word Fizz instead of the number and for the multiples of five array should contain word Buzz. For numbers which are multiples of both three and five array should contain FizzBuzz word.

Challenge | Solution

Examples

fizz_buzz(5) # [1, 2, "Fizz", 4, "Buzz"]

fizz_buzz(16) # [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16]