← All problemsSign in

Pop Issue

Alice and Bob are playing a balloon popping game. There is a stack of infinite balloons and each balloon is numbered *starting from 1*. To shoot a particular balloon, a person has to type in the *position* in which that balloon currently resides. After popping a particular balloon, all balloons above the popped balloon will come down one position. Alice challenges Bob to pop **Q** balloons of her

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