← All problemsSign in

Escape

CodeChefRating 2578Open on judge ↗

Chef has lost himself once again. This time he finds himself in a $N \times N$ maze with initial position $(1, 1)$. His goal is to reach position $(N, N)$. To do this, he can move from cell $(x, y)$ to one of the following $4$ cells - $(x + 1, y)$, $(x - 1, y)$, $(x, y + 1)$, $(x, y - 1)$ (only if the destination cell exists within the grid). To make Chef's life harder, someone has blocked $M$ ce

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start