[Community puzzle] Next car license plate?

If you want to test custom cases using CodinGame’s IDE, you can do so by enabling EXPERT mode, found under SETTINGS on the left of the puzzle statement.

1 Like

Maybe, but the issue I’m seeing isn’t the 1/1000 offset; What I’m seeing is being off every ~984880 iterations on the license number. Thanks for your input too :-).

Thank you, and thank you for using caps so that I can clearly see what you’re trying to say :slight_smile:

1 Like

My math isn’t the strongest, but being off by one on the wrapping value here would result in being off by two after 999*999 (=998001) wouldn’t it?

I appreciate your suggestions for fixing the code, and what you have done to help me out. Unfortunately I’m using C# and not jerk to write my code :-).

Well, I didn’t use caps so that you could clearly see them; I copied from the buttons themselves, which are labelled in caps! :grin:

1 Like

Incrementing plate number step by step? Please no!!!
These kind of Puzzles just teach Programmers to be inefficient.

My Program now passes all Test and all Validators except V6 with +1 000 000 . Could someone provide test cases that are more similar to V6 than Test6 ?
My Strategy was to first convert the Plate to 3 connected numbers, to keep the original structure but make adding easier.
Then do the adding while n is bigger than 0 and subtract everything from n that you add to one part of the Plate structure. Because I had 3 connected numbers (1 to 26*26)-(1 to 999)-(1 to 676) I managed to handle overflows of the last 2 numbers.
Then I reconvert the structure to a string License plate and put it out.
I also handled edge cases like ZZ->AA transition or 999->001.

Edit: I now tried a completely different approach. I converted the license plate to one number, then added n and then reconverted it to a string. The most difficult part was the reconversion to a string. This approach got my 100% on the Tests and also the Validators.
Thx for the Puzzle!

The issue is usually this.

Try generating more edge cases to thoroughly test your code.

Just a note on something that I was stuck on:

Spoiler

In the +100,000 case if you’re using sscan in a language like Golang. The language will try to interpret the number 010 as octal because it starts with a zero. Threw me for a loop for way too long :sweat_smile:

2 Likes

Continuing the discussion from [Community puzzle] Next car license plate?:

I’ve validated the solution but I wasn’t satisfied because some edge cases were missing. So I tried
AA-998-AZ
1
with AA-999-AZ expected as a solution, and it failed. I think you should consider adding more edge cases.
AA-998-AA
1
is too simple because you don’t need to think about letter changes

Thanks for this funny puzzle !

Also, Immatriculation : lettres interdites sur la plaque minéralogique

They removed “SS” in 2022.

But I guess making this puzzle more realistic has no point but to make it more cumbersome, and certainly not more interesting.