A carpark is arranged in a 4x4 grid and has a single entry/exit as shown in the diagram. A car has the size of a single cell of the grid. Cars can move through adjacent empty cells of the carpark either horizontally or vertically, but not diagonally. Cars cannot move outside the car park, except at the entry/exit cell. Can you place 9 cars in this carpark such that every car has a path to the exit?

enter image description here


I think this arrangement would work (red cells are those occupied by cars)

enter image description here

Other possible solutions

In the solution given, in the bottom left-hand corner I can move either car adjacent to the corner cell into the corner and still produce a valid solution. Also, I can reflect the whole diagram horizontally in all three cases and still produce a valid solution or I can rotate each solution anti-clockwise through a right angle and produce a valid solution.

And here is another way

enter image description here
and we can also rotate this solution clockwise through a right angle to generate another solution.

Furthermore, we can slightly edit that solution to generate another (which is diagonally symmetric as suggested by loopy walt in the comments)

enter image description here
This brings us to 12 overall (there may be more).

  • 1
    $\begingroup$ There is also a diagonally symmetric answer. $\endgroup$
    – loopy walt
    Mar 18 at 11:52
  • 1
    $\begingroup$ @loopywalt Thanks, I think I've found that now. $\endgroup$
    – hexomino
    Mar 18 at 12:06
  • 3
    $\begingroup$ What I love about the very last solution is it has 2 unreachable cells in the corners. This means we are getting 9 car spots from just 14 cells. Perhaps useful for real life carparks? $\endgroup$ Mar 18 at 12:10
  • 1
    $\begingroup$ In the bottom 2 solutions, it's once again possible to rot13(zbir rvgure pne nqwnprag gb gur yrsg rzcgl pbeare vagb gur pbeare) and produce a total of 6 more valid solutions (rot13(qhr gb gur ebgngvba bcgvba)). Similar situation with the rot13(bgure rzcgl pbeare) of the bottom one, although that only gives 1 extra solution because rot13(zbivat gur yrsg pne vf vqragvpny gb gur ebgngvba bs gur frpbaq-gb-ynfg bar). $\endgroup$
    – Egor Hans
    Mar 19 at 7:35
  • 1
    $\begingroup$ I would note that all of the solutions in this answer can be generated by the simple "parking algorithm" in the first paragraph of my answer to a similar question: puzzling.stackexchange.com/questions/55853/… $\endgroup$
    – Steve
    Mar 19 at 8:41

Here is yet another configuration:

enter image description here

  • 6
    $\begingroup$ I think hexomino covered that one in his second paragraph. $\endgroup$ Mar 18 at 12:31
  • $\begingroup$ @DmitryKamenetsky Nope. Not exactly this one. $\endgroup$
    – CiaPan
    Mar 18 at 16:54
  • 2
    $\begingroup$ Yes, exactly this one: Move C1R3 to C1R4 (as stated in the first sentence), then reflect horizontally (as stated in the second sentence) to produce this solution. $\endgroup$ Mar 18 at 20:38
  • $\begingroup$ To be fair, it's easy to overlook individual possibilities that result from the description, especially by missing the fact the alternations can be stacked. $\endgroup$
    – Egor Hans
    Mar 19 at 7:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.