← All problemsSign in

The Dirty Path

CodeChefRating 2717Open on judge ↗

Bob is currently at origin. Bob walks on $X$-axis and towards the right. In one move, Bob can either jump 1 unit to the right or 2 units to the right. Some of these coordinates are dirty. Bob wants to know the number of ways going to $(Y, 0)$ from $(0, 0)$. Two ways are considered to be different if there exists an integer $j$ such that the location of Bob after $j$ steps is different. Sounds l

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