Sort by

recency

|

1305 Discussions

|

  • + 0 comments

    Wow, Extra Long Factorials really push the limits of standard math tools! Tackling huge numbers like these definitely needs creative Unique SEO Strategies—think niche keywords, long-tail queries like omegle chat, and maybe even some math-based content clustering. I've seen unique approaches like leveraging coding forums and educational platforms for traffic. Always fun when math and SEO get to team up!

  • + 0 comments
    def extraLongFactorials(n):
        mult=1
        # Write your code here
        while n!=1:
            mult*=n
            n=n-1
        print(mult)
    
  • + 0 comments

    My Java 8 Solution

    public static void extraLongFactorials(int n) {
            BigInteger result = BigInteger.ONE;
            
            for (int i = 1; i <= n; i++) {
                result = result.multiply(BigInteger.valueOf(i));
            }
            
            System.out.println(result);
        }
    
  • + 0 comments

    Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-extra-long-factorials-problem-solution.html

  • + 0 comments

    void multiply(int x, vector& result, int& result_size) { int carry = 0;

    for (int i = 0; i < result_size; i++) {
        int prod = result[i] * x + carry;
        result[i] = prod % 10;   
        carry = prod / 10;   
    }
    
    
    while (carry) {
        result[result_size] = carry % 10;
        carry = carry / 10;
        result_size++;
    }
    

    } void extraLongFactorials(int n) { vector result(1000, 0); result[0] = 1; int result_size = 1;

    for (int x = 2; x <= n; x++) {
        multiply(x, result, result_size);
    }
    
    
    for (int i = result_size - 1; i >= 0; i--) {
        cout << result[i];
    }
    cout << endl;
    

    }