← All problemsSign in

Despo Sorter

Vishnuwardhan is desperate to have a sorting algorithm beginning with his own name so he discovers a procedure and explains it to Pranav in the following way. "You give me any permutation of the numbers from 1 to n and I will give you m commands each having li and ri where you must use bubblesort to sort the subarray from li to ri where indices li and ri are inclusive. So after you follow my m co

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