Sort by

recency

|

16 Discussions

|

  • + 0 comments

    The problem seems to be on the GCD for me. Just building the GCD matrix alone fails efficiency. Do you need to be a GCD expert to solve this? There must be some theorem or something that is required. I can't pass the effiencny tests. How can I make it faster?

  • + 0 comments

    python 3: not solve from test 6 bc exceed time.

            # Write your code here
            appe_list = []
            for i in range(r2-r1+1):
                for j in range(c2-c1+1):
                    appe_list.append(gcd(a[r1+i],b[c1+j]))
            print(len(set(appe_list)))  
    
  • + 0 comments

    Here is my solution in java, javascript, python, C, C++, Csharp HackerRank GCD Matrix Problem Solution

  • + 0 comments

    Here is GCD matrix problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-GCD-matrix-problem-solution.html

  • + 1 comment

    If you know about Mobius function and Inclusive-Exclusive Principle, solving this problem is more comfortable !