We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 175976a commit 5217f8eCopy full SHA for 5217f8e
src/factorialTrailingZeroes/factorialTrailingZeroes.cpp
@@ -65,7 +65,7 @@ class Solution {
65
int trailingZeroes(int n) {
66
int result = 0;
67
//To avoid the integer overflow ( e.g. 'n >=1808548329' )
68
- for(int i=5; n/i>0 && i <= INT_MAX/5; i*=5){
+ for(long long i=5; n/i>0 && i <= INT_MAX; i*=5){
69
result += (n/i);
70
}
71
return result;
0 commit comments