← All problemsSign in

ROOK

You are given a board of N X N squares.A rook starts in the top left corner and has to move to the bottom right corner of the board. Each square is either empty, blocked or contains gold coin. The rook can move only one step at a time. The rook can move either vertically or horizontally only 1 square at a time. Moving from one square to one adjacent square requires 1 second. Calculate the time r

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