Created
June 22, 2018 14:36
-
-
Save s4553711/32ede0bbec620ca36ce1942aa90f7817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
public: | |
int trailingZeroes(int n) { | |
if (n < 5) return 0; | |
int count = 0; | |
while(n >= 5) { | |
count += floor(n/5); | |
n /= 5; | |
} | |
return count; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment