diff --git a/Leetcode/Alpha.java b/Leetcode/Alpha.java new file mode 100644 index 0000000..d1080f3 --- /dev/null +++ b/Leetcode/Alpha.java @@ -0,0 +1,17 @@ +import java.util.Scanner; +class Alpha{ + static int trailingZeros(int n){ + int res = 0; + int powOf5 =5; + while(n>=powOf5){ + res = res+ (n/powOf5); + powOf5 = powOf5*5; + } + return res; + } + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n =sc.nextInt(); + System.out.println(trailingZeros(n)); + } +}