Chewbacca and Number

this is my code and it’s failing for 4rth and 5th test case. Can someone help me out

Hi @Legendankit
In the ques it is given that x <= 100000000000000000 so when you are taking p as int and when there is an input beyond the range of int then you are getting wrong ans. So just change the data type of p from int to long int.

Here is your corrected code :

If your doubt is clear then mark it as resolved.

Thank you so much…
:smiley:

1 Like