I had a doubt in this problem. What’s wrong with my approach? It is giving correct answer for all input test cases but shows wrong answer.
t = int(input())
for i in range(0,t):
n = int(input())
digit= 0
numb = n
summ=0
while(n!=0):
n=n//10
digit+=1
print(digit)
j=1
while(j!=0):
x = (5**j)
# print(5**j)
j+=1
summ=summ+(numb//x)
a = str(x)
if(len(a)==digit):
break
print(summ)
Yes I had certainly figured out this logic after spending some time. But I wasn’t able to understand what was wrong in my first approach. I got it though. Thanks to the question asked by @galencolin. Anyways, thanks for the help guys @zephxr@pratik121 .