[Community Puzzle] PARK PILOT

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @bk521,validated by @Teunisv,@jordan_codingame and @FredericLocquet.
If you have any issues, feel free to ping them.

Interesting but difficult to understand assumptions, especially if you don’t look at Constraints (this should have been included in the description earlier). Precode is misleading (the second loop goes for the length of the road when only parking spaces are expected → this should be underlined in the code within the comments).

An example would be useful for recognizing the length of a vehicle.

Yes it’s a little bit hard to well understand the statement but with the help of images it can be done. It s an important part of the challenge, the solution is really easy to code after.

1 Like

This puzzle asks for the vehicle length. This is an interesting and easy enough challenge, and with many ways to find it.
After getting the vehicle length, the rest is quite routine.

There are rooms for improvement:

  1. Constraint should be used to write constraints. Now it is used for writing statement. We are missing constraints like maxLen of a vehicle, min/max length of N, etc.

  2. Too much relying on external sources. In fact, it shows the shortcoming of CG not allowing anchor to in-site graphics. Before this improvement can be realized, I’d rather use the banner to paste one really useful graphic than linking to several outside.

3 The definition of index used in the answer can be clearer.

1 Like

Hi all,
I have a question regarding this puzzle. In the Test Case 2 the length of road is 74, however the last available space index is 79L. I am confuse as my understanding is that the parking space should be inside this lenght, so, not sure how is possible to park on 79L if the length of the road is 74.
I have passed all the test case except the second one (my last result is 73L)
So, I guess I misunderstood something, but not sure what… Could you please give me a hint??
Thanks a lot!!

2 Likes

I have updated the statement based on some of your comments. More details in the comment I have left in the contribution view.

I agree with your point regarding external sources.

I think it is an error in the description. I have now updated it as “the number of sensor data strings to read”. Hope that clarifies the matter.

Well done. Tks

Puzzles should be self-contained, except for the references given to help readers learn the subject further, if they so desire. A self-contained puzzle shows that the author has done a thorough homework, and is safer for readers as clicking on links always entails a level of risk, whether now or in the future.
In order to discourage the practice of referring to external sources, I won’t work on this puzzle (this will be the first ‘easy’ puzzle I avoid), and I encourage everyone else to do the same (unless, of course, the problem is corrected).

1 Like

Sorry but I don’t understand your precision, for me Test 2 is still confusing
Thanks for your help

From the statement:

At the start, the back of the vehicle is at index 0. The sensors collect data at that moment, and every time when the vehicle has moved forward 1 unit.

and

The sensors are located at the four corners of the vehicle, and each string gives the data of the sensors in the order of:
Front Left - Front Right - Back Right - Back Left

Do these help? If not, please specify what your confusion is about.

Finally it was ok before your answer, but thanks for your reactivity =)

One of the external link is a website who ask for notification. How to contact the codingame team about that ?

How do you finish the first part, It says Found: 20L
Expected: 27L
The it says, Found: 27L
Expected: 20L

Maybe you have read it wrong? The expected output for the first case should be:

5
20L
27R
28R

By the way, you can find the full expected output of the cases by clicking the button to the left of the button “PLAY ALL TESTCASES”.

Hi,
I just did the puzzle just now, and it’s still asked to find 79L for only 74 iterations.
If 79L is not displayed in test 2, it fails.

I can’t validate (during submission) test 1 and test 3… and no explanation on what makes it no longer pass when it passed in the IDE…

So, even if I liked this puzzle, BUT it’s boring not to be able to exceed 60% without even knowing why… :wink:

1 Like

You may PM me your code to take a look if you want.

1 Like

i have the same issue. 79L for 74 road length.
and funny enough validator 2 passes but validators 1 & 3 don’t.
have you managed to get passed it? can you give me some hints on how to proceed?

@5DN1L was the “79L spot” problem not fixed yet or is it on my side now? pls help

thank you both in advance

The road length isn’t 74 - you have 74 data points for the back of the car and 74 for the front of the car. As the car must be at least length 1 these won’t entirely overlap.

1 Like

I enjoyed this puzzle. I’d like to see a test case where there is not a single open space on the left side. The length of the car would then need to be determined by the right sensors.