package com.fishercoder.solutions;
/**Given an integer n, return the number of trailing zeroes in n!.

 Note: Your solution should be in logarithmic time complexity.*/
public class _172 {

    public int trailingZeroes(int n) {
        int result = 0;
        while (n > 4) {
            n /= 5;
            result += n;
        }
        return result;
    }

}

@@ -31,16 +31,53 @@
 ons;%0A/**
+%0A * 172. Factorial Trailing Zeroes%0A%0A 
 Given an
@@ -133,16 +133,169 @@
 in n!.%0A%0A
+ Example 1:%0A%0A Input: 3%0A Output: 0%0A Explanation: 3! = 6, no trailing zero.%0A%0A Example 2:%0A%0A Input: 5%0A Output: 1%0A Explanation: 5! = 120, one trailing zero.%0A%0A
  Note: Y
@@ -348,16 +348,19 @@
 plexity.
+%0A%0A 
 */%0Apubli
@@ -375,16 +375,50 @@
 _172 %7B%0A%0A
+  public static class Solution1 %7B%0A
     publ
@@ -454,18 +454,16 @@
 %7B%0A      
- 
- 
 int resu
@@ -470,18 +470,16 @@
 lt = 0;%0A
-  
       wh
@@ -500,20 +500,16 @@
         
- 
-   
 n /= 5;%0A
@@ -516,20 +516,16 @@
         
- 
-   
 result +
@@ -539,14 +539,10 @@
     
-  %7D%0A  
+%7D%0A
     
@@ -564,11 +564,14 @@
 ;%0A    %7D%0A
+  %7D
 %0A%7D%0A

refactor 172