text: public static BigInteger factorial(int n) {if (n == 0 || n < 0) {return BigInteger.ONE;}if (cache.containsKey(n))  {return cache.get(n);}BigInteger result = BigInteger.valueOf(n).multiply(factorial(n - 2));cache.put(n, result);return result;}