Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 924 Bytes

super_fizz.markdown

File metadata and controls

18 lines (13 loc) · 924 Bytes

SuperFizz

In this assignment you'll implement an algorithm that is actually used in some programmer interviews. And the really shocking part is that some people fail it! This is an extension of the FizzBuzz problem. Write an implementation of the following algorithm.

Iterate through the numbers 0 through 1000 and for each one print out exactly one thing. These rules are in descending priority:

  • If it's evenly divisible by 3, 5, and 7 print SuperFizzBuzz
  • If it's evenly divisible by 3 and 7 print SuperFizz
  • If it's evenly divisible by 5 and 7 print SuperBuzz
  • If it's evenly divisible by 3, print Fizz
  • If it's evenly divisible by 5, print Buzz
  • If it's evenly divisible by 7, print Super
  • Otherwise print just the number

First try to implement the algorithm in the clearest way you can.

Once you get that working, create a second version that uses as few instructions/lines as you can.