Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
@gribskov: if your solution takes 240 ms per test then the total time will be more than 800ms. Or, if your solution is too slow overall you won't see the total time it took, only the successful tests up to that point are shown.
My O(N) approach (that does not involve any data structures) can pass all tests in Python but not in JavaScript.
In JavaScript, my code cannot pass the test case with an array of 999999 elements. I got this error:
You code is too slow ;-): expected '31ms' to equal 'Less than 6ms per testcase'.
according to CCPThugHunter 800ms should be sufficient for all tests. My code runs in 240ms, but is not accepted
Yep, 0 is correct. When you target an index to then count to the left and right, the value stored on that index is left out meaning that at index 0, you ignore the 20 which leads to sums of 0 on both left and right.
I see where you found the 0 sum at index 0. That is just confusion. You won't get to 0 anymore if you don't count into the left and right sums the number at the target index.
So, counting the -1 at index 0 which is incorrect gets you 0 to the left and 1 to the right.
Index 2 is correct in the end.
This comment is hidden because it contains spoiler information about the solution
Strange, it worked here. Tested with the above solution and 'tThe Holy Bible' correctly results in 'BbeehHillotTy'. Had to update the test as well to account for the 't'.
Hi, the solution will pass only if you find a way to solve the problem without loops. as wrotes below in the comments inList numbers are sequentially from 1 to n this should help you to solve the problem without loops
So what kind of time should we achieve for the random tests? I get times in the 240 usec range but still fail
This doesn't answer my question. What response time are you expecting to not fail the time test.
You are right. I was able to pass them with your solution and some other I didn't try before from the solutions page. Your reasoning makes sense. Thanks for checking it out sayan warrior.
The tests are not broken. I just passed both Python and Javascript versions, the tests work fine.
It is possible that the kata has been updated which has caused some old solutions to be too slow on the latest language version, but the kata is still quite possible.
!!! TESTS ARE BROKEN !!!
Tried multiple solutions and couldn't get the execution time to be accepted,
INCLUDING the ones from the solutions page after skipping the kata
Tests still failed due to long execution time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...