Sample Output Error


#1

For this given input - A : [ 5, 1, 3, 2, 4 ]
My program shows output -5 1 4 2 3
I think my output satisfy the condition given in the question ,then why my solution is wrong.
Can anyone help me?


#2

2 1 4 3 5 is lexicographically smallest