Ad
  • Default User Avatar

    You probably have a quadratic time solution !
    You can solve this only looping through it once and have it be linear time.

  • Default User Avatar

    About two months ago, I had no idea how to code. I cannot believe that I solved this today. Excellent kata!

  • Custom User Avatar

    how do you even get it to work for this such big numbers. my code only works for smaller numbers. perhaps i will really need a spoiler on that. i will be glad if you can put me through.

  • Default User Avatar

    you're right, guess I need to improve my reading skills lol

  • Default User Avatar

    In kata description it is written:

    [(a, b), ...] or [[a, b], ...] or {{a, b}, ...} or ... will be sorted in increasing order of the "a".

    So you need to sort your returned array according to first element, yes.

  • Custom User Avatar

    After I've solved it, I can't believe I hate math even more, whoa...

  • Default User Avatar

    n = 1000003: expected [ [ 550320, 908566 ],
    [ 908566, 550320 ],
    [ 559756, 893250 ],
    [ 893250, 559756 ] ] to deeply equal [ [ 550320, 908566 ],
    [ 559756, 893250 ],
    [ 893250, 559756 ],
    [ 908566, 550320 ] ]
    Just have this issue where I have to sort result even tho it's technicaly right but order is wrong?