6 kyu

FizzBuzz Backwards

571 of 1,109marbiru

Description:

Traditionally in FizzBuzz, multiples of 3 are replaced by "Fizz" and multiples of 5 are replaced by "Buzz". But we could also play FizzBuzz with any other integer pair [n, m] whose multiples are replaced with Fizz and Buzz.

For a sequence of numbers, Fizzes, Buzzes and FizzBuzzes, find the numbers whose multiples are being replaced by Fizz and Buzz. Return them as an array [n, m]

The Fizz and Buzz numbers will always be integers between 1 and 50, and the sequence will have a maximum length of 100. The Fizz and Buzz numbers might be equal, and might be equal to 1.

Examples

  • Classic FizzBuzz; multiples of 3 are replaced by Fizz, multiples of 5 are replaced by Buzz:
    [1, 2, "Fizz", 4, "Buzz", 6]  ==>  [3, 5] 
    
  • Multiples of 2 are replaced by Fizz, multiples of 3 are replaced by Buzz:
    [1, "Fizz", "Buzz", "Fizz", 5, "FizzBuzz"]  ==>  [2, 3]
    
  • Multiples of 2 are replaced by Fizz and Buzz:
    [1, "FizzBuzz", 3, "FizzBuzz", 5, "FizzBuzz"]  ==>  [2, 2]
    
  • Fizz = 1, Buzz = 6:
    ["Fizz", "Fizz", "Fizz", "Fizz", "Fizz", "FizzBuzz"]  ==>  [1, 6]
    
Fundamentals

Similar Kata:

More By Author:

Check out these other kata created by marbiru

Stats:

CreatedSep 4, 2017
PublishedSep 5, 2017
Warriors Trained2467
Total Skips55
Total Code Submissions5531
Total Times Completed1109
JavaScript Completions571
Python Completions516
Ruby Completions63
Total Stars62
% of votes with a positive feedback rating93% of 245
Total "Very Satisfied" Votes214
Total "Somewhat Satisfied" Votes27
Total "Not Satisfied" Votes4
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • marbiru Avatar
  • ZozoFouchtra Avatar
  • anter69 Avatar
  • Voile Avatar
  • bornForThis Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad