(MAX2) Cannot find the testcase where my program fails

My submission
Question
First if condition checks whether the number is odd or not, if yes, then simply print 0 and move on.

I saw other people do the same question by finding the number of trailing zeroes, I understood that method, but want to find where does my code fail?

The constraints of the Q states that the no of digits can be upto 10^5
but we can only store numbers upto 19 digits using long long.
Hence long long wont work and will cause overflow and hence wrong result.
So, you have to work with strings and find the no of trailing zeros.
Hope that helps!!!

1 Like