Guide Ted
CodeChefOpen on judge ↗
Ted needs to cross an $X*Y$ grid. He is currently at position $(0,0)$. He needs to reach the position $(x,y)$. The only possible moves allowed are right $[(a,b) to (a+1,b)]$ and up $[(a,b) to (a,b+1)]$. However, there a pothole in the grid at any random location $(A,B)$. Ted must not step on this position lest he should fall in it and break some bones. You need to tell Ted the number of possible
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.
Sign in to chat with the tutor and save your progress.
Sign in to start