knakul853

Untitled

Jul 15th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. /**
  2. knakul853
  3. **/
  4. class Solution {
  5. public:
  6.     int trailingZeroes(int n) {
  7.        
  8.         int ans = 0;
  9.        
  10.         while( n )
  11.         {
  12.             ans += n/5;
  13.             n/=5;
  14.         }
  15.        
  16.         return ans;
  17.        
  18.     }
  19. };
Add Comment
Please, Sign In to add comment