← All problemsSign in

Sorted Permutations

Monocarp, a botanist discovered a new type of species of flower, he noticed that when red light was made incident on a group of some k flowers (not necessarily consecutive) then that k flowers sorted according to their heights and moved at the beginning of the queue of the flowers and when yellow light was made incident on the flowers the k flowers sorted themselves and moved at the end of the que

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