← All problemsSign in

Grid Path (Easy)

CodeChefRating 1857Open on judge ↗

**This is the easy version of the problem and is worth the usual 100 points. Here, $Q = 0$, i.e. there are no updates to the grid.** You have a binary grid of size $2 \times N$. The $j$-th character of the $i$-th row is $A_{(i, j)}$. In one operation, you can choose a row $X$ and a column $Y$ ($1 \le Y < N$); and then swap $A_{(X, Y)}$ and $A_{(X, Y + 1)}$, i.e. you are allowed to make adjacent

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