class Solution {
public int trailingZeroes(int n) {
if(n==0 || n==1)
return 0;
int[] strg=new int[n+1];
int c=0;
//seed
strg[0]=1;
strg[1]=1;
for(int i=2;i<=n;i++)
{
strg[i]=strg[i-1]*i;
}
int x=strg[n];
while(x!=0 && x%10==0)
{
c++;
x=x/10;
}
return c;
}
}
getting wrong answer after 12. what is wrong in this code?