@@ -0,0 +1,1536 @@
+import java.lang.Math;%0Apublic class Solution %7B%0A  public static int zeros(int n) %7B%0A      // your beatiful code here%0A  %09String fact = Integer.toString(factorial(n));%0A  %09String%5B%5D numbers = fact.split(%22%22); %0A  %09int numZeros = 0;%0A%0A  %09for (int i = numbers.length - 1; i %3E 0; i--) %7B%0A  %09%09if (Integer.parseInt(numbers%5Bi%5D) == 0) %7B%0A  %09%09%09numZeros++;%0A  %09%09%7D else %7B%0A  %09%09%09break;%0A  %09%09%7D%0A  %09%7D%0A%0A  %09return numZeros;%0A  %7D%0A%0A  public static int factorial(int n) %7B%0A  %09if (n == 1) %7B // base case%0A  %09%09return 1;%0A  %09%7D%0A  %09return n * factorial(n -1); %0A  %7D%0A%0A  public static double factorial2(int n) %7B%0A  %09if (n == 1) %7B%0A  %09%09return Math.pow(5, n);%0A  %09%7D%0A  %09return (n / 5.0) * (factorial(n - 1) / 5.0);%0A  %7D%0A%0A  public static void main(String%5B%5D args) %7B%0A  %09// Testing factorial%0A  %09int fact1 = factorial(12);%0A  %09System.out.println(%22Factorial of 12: %22 + fact1);%0A%0A  %09// Test 2%0A  %09int fact2 = factorial(13);%0A  %09System.out.println(%22Factorial of 13: %22 + fact2);%0A%0A  %09// Test 3%0A  %09int fact3 = factorial(17);%0A  %09System.out.println(%22Factorial of 17: %22 + fact3);%0A%0A  %09// Testing factorial2%0A  %09double fact4 = factorial2(12);%0A  %09System.out.println(%22Factorial of 12: %22 + fact4);%0A%0A  %09// Testing zeros%0A  %09int numberOfZeros = zeros(12);%0A  %09System.out.println(%22Number of trailing zeros in factorial of 12: %22 + numberOfZeros);%0A%0A  %09// Test 2%0A  %09numberOfZeros = zeros(13);%0A  %09System.out.println(%22Number of trailing zeros in factorial of 13: %22 + numberOfZeros);%0A%0A  %09// Test 3%0A  %09numberOfZeros = zeros(17);%0A  %09System.out.println(%22Number of trailing zeros in factorial of 13: %22 + numberOfZeros);%0A%0A  %7D%0A%7D%0A

Add Solution.java