← All problemsSign in

PRESENT BY LEVI

Levi has to give presents to children on new year eve. A large stack of n present numbering from 1 to n is present; the topmost present has number x1, the next present is x2, and so on; the bottom present has number xn. All numbers are distinct. He has a list of m distinct presents he has to send: b1, b2, ..., bm. He will send them in the order they appear in the list. In order to give a prese

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