ARRAYSORTING Editorial

Hello coder_zs07,
Try a test case: 4,5,1,2,3
I hope you get point.
As it may increase.
Hint for a similar approach: Try to have a minimum difference could help (i.e. difference of 1)
You can refer this solution for more clearance.

hey can you tell me where i am getting wrong .
my idea is to move 1 to first position by swapping with adjacent and so on for rest of the number to their respective position.
if i am doing wrong can u explain .
here is my code solution