What should be the expected output for number with all 9’s, say 999999?Is it 111111 or 100000 as we are inverting the digits?

And for a number like 20004567, what should be the output?

# Chewbacca and number

For 999999 we should get 900000 because the digit can be inverted only and number of digits must not be changed.As if the leading 9 is inverted it will make it 0 which is equivalent to one less digit in the final answer and that must not happen .

for 20004567 we must have 20004432.

1 Like