Chewbacca and Number

I could not understand this problem
explain to me with some more possible answer

@vivekpatel
hello Vivek,
this problem is simple. in this problem u will given a number and u need to find minimum number that can be formed by inverting some of the digit by 9-t (here t is the digit).

one case is mentioned that formed digit should not conatin leading zeros.
ie if given number has 9 at its msb place then we cannot change it to 0.

for example-:

  1. 1237 -> 1232 (we can replace 7 with 9-7 )
  2. 8296 -> 1203 ( we can replace 8 with 9-8 and 9 with 9-9)
  3. 9982 -> 9012 ( here we cannot replace first 9 with 0 becuase it will produce leading 0 , for second 9 we can replace it with 9-9,and 8 with 9-8)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.