← All problemsSign in

Spider-Man Met Kangaroos

On his way back to home, Spider-Man saw $N$ kangaroos standing in a queue. The age of the kangaroo standing at $i^{th}$ position is $A_i$ (in days), & it can jump with a length of $L_i$. Spider-Man wants your help to find the **minimum** number of jumps required by kangaroos so that they can stand in **decreasing** order $w.r.t.$ their age. Kangaroos can jump only in one direction, $i.e.$, **from

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