Sort It!
CodeChefOpen on judge ↗
Shriram got bored during quarantine, so he created a permutation. He has a permutation of $1$ to $N$. A permutation of numbers from $1$ to $N$ is defined as a set of $N$ distinct numbers where each number lies in between $1$ and $N$ inclusive. He also has $2N$ operations: in each operation he can reverse any non empty subarray of the permutation. A subarray is defined as a subset of consecut
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