Right answer but getting failed.idk why?


#1

input: 51324
my output: 51324
expected output:21435 why?


#2

Read the NOTE part at the end of the question.
You have to return the lexicographically smallest if multiple exists.


#3

Your answer is correct but not lexicographically smallest. In the question it is mentioned if multiple answers exist then you need to return the lexicographically smallest one. If you are stuck, try reading the hint for the question.


#4

Check this:
image