Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Formula is:floor(n/5)+floor(n/5^2)+floor(n/5^3)+floor(n/5^4)+floor(n/5^5)+----till n/5^i=0 code: int trailingZeroes(int n) { long long int i=5,count=0,c=1,x; while(n/i){ count+=(n/i); i*=5; } return count; }

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.