Input Case [ 769, 533 ]

A : [ 769, 533 ]
The expected solution for this test case is 533 769

How is this the next permutation?

My bad, saw the problem statement.
If such arrangement is not possible, it must be rearranged as the lowest possible order ie, sorted in an ascending order.

Click here to start solving coding interview questions