i m not able to prevent leading zeros that’s why failing 1 testcase how to do that?
/ide.codingblocks.com/s/269937
Chewbacca and number
hello @poojadas408

add this condition only for the left most digit.
for all other digit replace a with -> min(a,9-a)
Hey @poojadas408
Replace line 13 by
if((c<=a) and (c!=0 or x!=x%10)){
RHS will be true if c isn’t zero or if x is not a single digit
So basically we are excluding the case when leftmost digit is 9
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.