Everyone knows the FizzBuzz sequence. It goes something like this:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz . . .
In case you don't know, if the number is divisible by 3, it's
Fizz. If it is divisible by 5, it's
Buzz. If it is divisible by both, it's
FizzBuzz. If it is not divisible by both, it's just the original number.
Take two inputs, for example (space separated here)
For this specific example input, you should output
9, the third
Fizz. To be more general, take a
word and a
number, output the
word input may be
Number, and in this case, you should output the
numberth number in the FizzBuzz sequence that is not
You may choose any 4 distinct, consistent inputs representing
Fizz 3 => 9 Buzz 4 => 25 FizzBuzz 2 => 30 Number 312 => 584
Shortest code wins!
- No standard loopholes.