Ad
  • Custom User Avatar

    Yes, you can check this in the example

  • Custom User Avatar

    You must be reading something wrong because the 3 tests under the too short label have less than 10 elements. Maybe you meant too long instead, if that's the case then the answer is yes.

  • Custom User Avatar

    I didn't hide the answer, and the tests are fine. That's why I resolved it.

  • Custom User Avatar

    Why did you hide this answer and marked as resolved, wtf?

  • Custom User Avatar

    It's not about being efficient, most likely, your code has an infinite loop.

  • Custom User Avatar

    It's happening because inputs for tests are generated randomly. your solution has a bug which does not recognize some inputs correctly, and sometimes its 56 of randomly generated inputs, and sometimes its 52.

  • Custom User Avatar

    When you click Test, your code is tested against the (4) fixed tests you can see in bottom right of your screen.

    When you click Attempt your code is being tested against 50 random tests, in addition to 11 fixed tests for a total of 61 tests.

    Since the random tests are, well, random - it is possible that you will randomly pass/fail some of them each time you re-click Attempt.

    If you are getting approx 50 out of 60 tests correct, I'm guessing therefore there is a subtle bug in your code that only "appears" in a few rare situations/cases.

    You can debug using print(h, bounce, window) in your code - this will allow you to see which inputs cause you to fail, then up to you to figure out what is going wrong (rounding error? breaking too early? etc)

  • Custom User Avatar

    It means your solution takes too much time to solve the problem. You have to find a more efficient way to solve it.

  • Custom User Avatar

    Click reset, I see this:

    test.assert_equals(duplicate_count("abcdeaa"), 1)
    
  • Custom User Avatar

    And it is, are you reading the logs ok? Which test?