The question is not at all understandable . Please explain what we have to do in this question by some example . I am not asking for solution just asking you to explain the question
Chewbacca and number
you are given an integer x and you have to minimize this number by inverting it’s digits
inverting digits means subtracting the digit with 9
if digit is 4 then it’s invert digit will be 9-4 =5
now understand this with some examples
input: 4545
output : 4444
this is the min no by inverting some digits
you can conclude one thing from here that to minimize number we only have to flip digits which are greater than 4
input: 9999
output 0
you flip all numbers to minimize but final ans should not contain leading zeros hence ans is 0 not 0000