The test cases don't do what the problem statement asks


#1

Example 4 is:
I/P = [20, 50, 113] which numerically represents 2050113
O/P = [20, 113, 50] which numerically represents 2011350

As per the problem statement, we should return the next biggest permutation of these numbers but 2011350 is clearly smaller than 2050113. The output should be [50, 113, 20] which represents 5011320 and is the next bigger no. that we can get using the 3 numbers in the array.


#2

I have also faced the same problem and unable to solve the problem