Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 391 Bytes

01-FizzBuzz.md

File metadata and controls

18 lines (13 loc) · 391 Bytes

FizzBuzz

The problem

Write a function f(N) that logs out numbers from 0 to N, but replacing:

  • numbers divisible by 3 with the word "Fizz"
  • numbers divisible by 5 with the word "Buzz"
  • numbers divisible by 15 with the word "FizzBuzz"

Concepts

Modulus

  • returns remainder of a division
  • % operator
  • eg: 7 % 3 = 1

Note:

Not the best solution performance-wise