[Community Puzzle] Reverse FizzBuzz

https://www.codingame.com/training/easy/reverse-fizzbuzz

Created by @ndc,validated by @Pi-Geometry,@Sethius and @_SG_Sebastien.
If you have any issues, feel free to ping them.

Nice problem but it is never stated that the list doesnâ€™t always go from 1 to n.
Itâ€™s something you discover when your testcase 3 fails and you check it.

So it should be more explicit.

Also, testcase 2 is weird cause if there are no numbers, we cannot know where the list starts.
So I made the list start at 1 if there are no numbers in the list, but I had to â€śinventâ€ť this rule.

2 Likes

It says so in the Input section: â€śNote that this line wonâ€™t necessary start from 1.â€ť
I also didnâ€™t notice this at first readâ€¦ But this extra makes the puzzle much more interesting.

Initially it always did but that made the puzzle trivial imo, itâ€™s better that way.

Didnâ€™t see that, my bad, but the use of name n is confusing, the part with â€śintegers in range from 1 to nâ€ť should be changed: â€śn consecutive integersâ€ť.

Nice puzzle, I solved it but have problems with the â€śFizz is Buzz Validatorâ€ť.
It seems I have something hard coded but all until parsing of â€śfizzâ€ť â€śbuzzâ€ť and â€śfizzbuzzâ€ť is dynamic.
Any sugestions?

If you get a message saying that validators differ from testcases to avoid hardcoded solutions, itâ€™s normal, it displays that even if you donâ€™t hardcode.
Your problem is probably somewhere else, as stated above, the list doesnâ€™t necessarily starts at 1, so maybe try to investigate that.

1 Like

There are too many borderline cases here.
Example would be the second test already, if there was only one buzz and otherwise only fizz, it would be impossible to find the right numbers.
The description is not informative enough for certain cases.
For easy it should at least be said that if there is only a buzz or fizz, there is also a number in the list.

Another example would be the last test.
If it were possible to take a 17 step, Buzz could also be 17.

Hi all,
despite having a 100% on tests, still got an 80% at the end, with the â€śEverything is a Fizz Validatorâ€ť that fails. Any advice ? Thanks

Check this:

``````12
Buzz
Buzz
Buzz
FizzBuzz
Buzz
Buzz
Buzz
FizzBuzz
Buzz
Buzz
Buzz
FizzBuzz
``````

`4 1`

2 Likes

wonderful, didnâ€™t get the buzz could be lower than fizzâ€¦
Thanks !

I agree with some other people. Even though the instructions later say the sequence doesnâ€™t necessarily begin at 1, that contradicts the top instructions for how the sequence is generated, which says that it goes from 1 to n. The instructions for how the sequence is generated should be changed so that the starting number and either the ending number or length of sequence are both specified, and that the expected results cover that range.

Hey there, also have some kind of problem.
I figured out this issue so far, that i get all test cases checked. But the result is on my site only 80% because â€śFizz is Buzz Validatorâ€ť fails. Because i can not see what my program put out and what the answer should be, i can not see what my failure is.

Does someone has advice to me, how to solve this anyways.

I will not include my code (yet) because as far as i understood, it is not okay to post full code.

Thanks mates for helping a beginer coder out

That validator is quite similar to the corresponding test, in that the input covers a similar number range, and the output numbers are the same (i.e. f = b). You may try creating custom cases to test your code.

Sadly, this doesnâ€™t helped me. I also wrote a program, that made me all variation from Fizz(1to60) and Buzz(1to60). And my code solves all of them.
May I can post my code here, so you can give me a closer hint and then we remove the code again from this posting?

Would be highly appreciated.