Gopal and his Task
CodeChefOpen on judge ↗
Gopal obviously is the leader of the class.His class mates are standing in line.His teacher has assigned him the task of arranging the students , into ascending order of their heights.But unfortunately ,Gopal knows only one thing, select k consecutive students, reverse their order. Finally, he wants their heights to be in the sequence of ascending order. Gopal wonders what is the fewest number
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.
Sign in to chat with the tutor and save your progress.
Sign in to start