Panda Guru LogoPanda
Guru

Juspay | unstop - round 2

Round 2

Questions: You are organizing a classroom where n students are currently sitting in scattered seats. To make group activities easier, you want to rearrange the students so they sit in consecutive seats, minimizing the number of moves.

Input Format:

Output Format:

Constraints:

Example:

Input 4 1 3 8 10 Output 2
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.