• Custom User Avatar

    'Looks like you've solved it'

  • Custom User Avatar

    That's not a kata issue, use question. for is a loop, and indexOf is a loop-alike method, they're nested so your algorithm is O(n ^ 2), it won't work.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    If you get that error, change your language version to 3.6.0
    I can't select other version, but to some people, 3.4.3 is shown too.

  • Custom User Avatar

    This problem is more difficult than a kyu 5 problem

    It is not.

    Quesion answered by Chrono79 alredy. Closing.

  • Custom User Avatar

    Thanks Chrono79

  • Custom User Avatar

    Yes, avoid them.

  • Custom User Avatar

    I should avoid nested loops all together? This problem is more difficult than a kyu 5 problem. By the way, thanks for the reply.

  • Custom User Avatar

    It's a problem with your code:

    JavaScript Completions 2496

    Your code should be O(n)

  • Custom User Avatar

    Mark your post as having spoiler content next time.
    Both functions are O(n ^ 2) filter and includes are loop-alike functions and they're nested in the first one, the second one have two nested for loops. Neither won't work. Your code should be faster O(n).

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Could you post your code in a comment (with a spoiler tag)? I think there's a problem with your code. In fact, many people say their code works in IDE but it always turns out the code is simply wrong.

    Apart from that, you can swap variables in Python like this: a, b = b, a.

  • Custom User Avatar

    You should be able to select Python 3.6 now. I don't know if that error has anything to do with Python version though.

  • Custom User Avatar

    Damn, so I just wasted my time on this kata? :(
    I guess I'll have to rewrite some of the code...

  • Custom User Avatar

    See the python versions available for this kata, they're less than 3.6.

  • Loading more items...