Simple Sorting
CodeChefOpen on judge ↗
Stark has a selection of balls. Each ball has a number on it. The balls are placed in a sequence, and Stark wants to sort them (in ascending order). He has a device to manipulate the balls, which performs the following operation. Stark can select a subset of balls, and the device will lift the selected subset, shift the selected subset to the right (keeping the order in the subset), shift the not-
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