TRPLSRT Can anyone suggest a test case where my code is going wrong

this is the link to my code…
[CodeChef: Practical coding for everyone]
(http://link)

thanks in advance…

9 4
7 4 5 9 3 2 1 6 8
It can be sorted in 4 operation.

1 Like

1
8 3
1 3 2 6 4 5 8 7
you code is giving -1 but this can be solved in 3 moves

1 Like

Ans should be 4 for all

6
9 4
6 1 9 3 2 5 8 7 4

9 4
9 7 5 8 3 4 6 2 1

9 4
9 7 5 8 4 3 2 6 1

9 4
9 7 5 8 6 1 3 2 4

9 4
9 7 5 8 6 3 2 1 4

9 4
9 7 5 8 6 4 2 3 1

1 Like

thanks

1
20 20
18 12 19 7 14 3 6 15 16 5 8 13 20 10 17 9 2 11 4 1

For this the answer must be computed in 13 steps for subtask 2 and in 10 steps for subtask 3. But your code does it in 15 steps.