The given expected output are different than the requirements. Or maybe I don't understand the question


#1

For Input: 8 10 13 15 9 6 4 2 1
The expected output is 10 15 1 2 4 6 9 13
While clearly there are smaller numbers than the output, but bigger than the input. e.g. 10, 14, 13, 15, 2, 6, 9 is smaller than 10 15 1 2 4 6 9 13 and bigger than 10 13 15 9 6 4 2 1.


#2

Yes I completely agree for example for
for INPUT - 8, 11, 3
EXPECTED OUTPUT - 11, 3 , 8
i.e they have arranged it in ascending order but according to me the OUTPUT should be - 8, 3, 11


#3

output is * 8 10 15 1 2 4 6 9 13 and its correct. i dont know who told u that expected output. but my algo is running and is reasonable.


#4

As I understood, the output should be of a number bigger than the given number represented by the array.
So if the array is [8, 10, 13, 15, 9, 6, 4, 2, 1] then it represents the number: 810131596421.
And by changing the order of the array, I should give the next possible bigger value.
So for the array I gave, it should be: [10, 14, 13, 15, 2, 6, 9] and not 10 15 1 2 4 6 9 13.
I guess I didn’t understand the requirements… Can you help? what did I miss?


#5

Yes I have the same question as well. For input 8,11,3 if the expected output is 11,3,8 then it can be represented as number 1138.
Also 11,3,8 is not even in the ascending order.
And 1138 is lesser than 8113
And yes 8311 is certainly the next closest number.
I think the question is doing justice to what it expects.


#6

for input : 8 10 13 15 9 6 4 2 1
the expected output: 8 10 15 1 2 4 6 9 13 does not look like the next permutation
I mean if greater than 1 element is permuted at the same time, could it be called next permutation?
As per my understanding of the problem statement, the output should have been
8 10 13 2 15 9 6 4 1.
And 810132159641 is lesser than 810151246913.