Ad
  • Custom User Avatar

    A lot of part of your code is redundant and can be done in O(logN).

    • You are checking unnecessary values on whether they are being prime.

    • You need not to pre-generate prime values beforehand

    • You need not to sort and remove duplicate entries

    Remember that you only need information on the shared prime factor numbers between each numbers in the list.

  • Custom User Avatar

    Not true, last line would return false.

  • Custom User Avatar

    Sorry your code is wrong somewhere.
    BTW before posting issues look at the top of the page to see how many people passed the kata (2732 in JS). When this number is high, high are chances that your code has a problem.
    Cheers.