Not able to understand the question

Luke Skywalker gave Chewbacca an integer number x. Chewbacca isn’t good at numbers but he loves inverting digits in them. Inverting digit t means replacing it with digit 9 - t.

Help Chewbacca to transform the initial number x to the minimum possible positive number by inverting some (possibly, zero) digits. The decimal representation of the final number shouldn’t start with a zero.

Input Format
The first line contains a single integer x (1 ≤ x ≤ 10^18) — the number that Luke Skywalker gave to Chewbacca.

Constraints
x <= 100000000000000000

Output Format
Print the minimum possible positive number that Chewbacca can obtain after inverting some digits. The number shouldn’t contain leading zeroes.

Sample Input
4545
Sample Output
4444
Explanation
There are many numbers form after inverting the digit. For minimum number, check if inverting digit is less than or greater than the original digit. If it is less, then invert it otherwise leave it.

Hello Shubham,
In this question, you just have to invert the number for eg 9876 with 6789 but the twist is that you have to Subtract every digit from 9. for example we have 9876 so its invert will be 6789 and when we subtract every digit from 9, then we have 9-6 = 3, 9-7 = 2, 9-8 = 1 and 9-9 = 0.
So the final number will be After subtracting and inverting 0123. This must be your output.

But remember the inverted number must not contain the zero from starting, for eg.
6789 the result will be, the inverted number will be 9876 and chewbecca number will be, after subtracting from 9 it will be 0123. this will not be accepted if you are getting zero from leading then don’t change that number.
i hope this will be help.

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.