Chewbacca and number

what is the problem in this code for chewbacca and number ? it is giving wrong answer for two test cases .
link of the question- https://hack.codingblocks.com/contests/c/452/62.

link of the code- https://ide.codingblocks.com/#/s/16902

for the larger number 13 digit number yr programe is throwing garbage value because the fact in which u are multiplying with 10 is declare int just correct it

1 Like

@phantom
i have modified the code
https://ide.codingblocks.com/#/s/16924

[ link of the question- https://hack.codingblocks.com/contests/c/452/62 ]
but still it is giving wrong answer for two test cases ; now it is not working for 19-digit number and above.

Hey, Look I also know that this question could be solved using this approach. But there is a video in which prateek bhaiya has solved it using Char. I want to learn that. Help me out.

And this code is also not passing all the test cases