x20mar / FizzBuzz

Attempting to write an efficient FizzBuzz solution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FizzBuzz

FizzBuzz is a classic programming problem that is often used during an interview to ensure that the candidate can actually code.

The task is described as so:

Write a program that prints the integers from 1 to 100 (inclusive).

But:

  • for multiples of three, print "Fizz" (instead of the number)
  • for multiples of five, print "Buzz" (instead of the number)
  • for multiples of both three and five, print "FizzBuzz" (instead of the number)

Now most solutions on the internet show the use of the modulo operation. However the modulo operation is an expensive function. The aim for this repository is to find a solution where the modulo operation is not used.

About

Attempting to write an efficient FizzBuzz solution

License:MIT License


Languages

Language:JavaScript 100.0%