Not able to understand the problem

Hey, I am not able to understand the problem can u just tell me how we are getting the output?

Hey @priyacharaya10 , What the questtion is asking is basically that what is the possible smallest number we can get by interchanging digits (changing t to 9-t) .
Now if we already have the smallest number that can be : we will change 0 digits
Otherwise we will change some digits to make it the smallest number

For ex : 4545 has two digits which when interchanged will give a smaller number ( 5 when interchanged will give 4 ) so all the 5 in the number arre changed and the output becomes 4444.

Hint : Change all the numbers with value >4 . But keep in mind that you cannot make the first number 0.

I hope it helps ! Happy Coding !
If you have any other query You can ask me otherwise please mark the doubt as resolved .