in line 18 , digit>=5, how we choose 5 ?
Digit>=5, how we choose 5?
BECAUSE
in case the digit is 5 then 9-5 will be less than 5
Our main motive is to reduce the value of the number, when subtracted with 9
for instane if the digit is 4
and if we try subtracting it from 9 … then it would result in a greater value
Hence 5 ownards when subtracted from 9 it results in a smaller value
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.