Ad
  • Custom User Avatar

    This takes longer than 6 seconds to load, so it was failing for me. I was able to load for k = 400, but I'm concerned that this assertion may cause the tests to become too brittle and may break existing solutions. There's also to guarantee that the assertion will really weed out non O(N) solutions. Testing for time complexity is a real pain. I appreciate the feedback!

  • Custom User Avatar

    Marking issue as resolved.

  • Custom User Avatar

    Fixed. Here are the changes that I made:

    • Updated description to require solution in O(N) time.
    • Added tests for huge randomly strings for both JavaScript and Python.

    I'd be interested to see if your initial O(N^2) solution still works.

  • Default User Avatar

    you upvote a beta kata by choosing ready after you have solved it

  • Custom User Avatar

    Interesting. I'm going to add some randomized tests tonight. I may need to throw out the O(n) test because I'm not sure if it can be truly tested, but I'll try.