Leaping Over the Stones (bonus subtask)
CodeChefOpen on judge ↗
Problem description. There are n stones lying in a straight line numbered from 1 to n . You are at stone 1 and your destination is stone n . In each move you can either jump to a stone ahead or 2 stones ahead or 3 stones ahead .You can take any number of moves but you have reach the final detination i.e stone n. Given n you have to answer in how many distinct paths can you take to reach the , f
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