Ad
  • Custom User Avatar

    I think that comment is blocked from me. Sorry I am still getting familiar with how this site works.

  • Custom User Avatar

    I am also having this problem with javascript. I put an empty object at the leaderboard#position[0] position and I pass every test except the 500 length. Mine is 501. I am going to try to remove a random user and hope to cheat by the tests. However, I am wondering if there is something I am missing or not aware of that will allow me to conform to the desired results. Other than that, cool kata - I had no clue that libraries like cheerio could be brought in.

  • Custom User Avatar

    No, it's only for higher level katas and those that have PERFORMANCE or OPTIMIZATION tags. In general, it's a good thing solving a problem in the less time possible.

  • Custom User Avatar

    Do you happen to know if this is a rule that applies to all codewars challenges?

  • Custom User Avatar

    You have 3 nested loops there (for, includes and indexOf). It won't work with big arrays, that's the reason for the timeout.

  • Custom User Avatar

    If includes is nested inside every that's O(n^2) and it's not fast enough with big arrays. Try using not nested loops.

  • Custom User Avatar

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