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.
In JavaScript, the biggest test case in the full test suite has
11000000
tiles, so it must be a linear (O(n)) algorithm. (other languages should have similar sizes)Hi @Dmillenaar and welcome to Codewars;
Since you are new I just wanted to clarify something, in case that's what is causing the difference between your IDE and Codewars:
When you click "Test" on any kata, your code is tested against the (small, few in number) tests visible in the bottom right of the kata environment. In this kata, these are the
SAMPLES
that are approximately 6-7 in number, with small input strings. These are designed to be "easy" tests, to check your code logic etc.When you click "Attempt" you will then encounter the full set of kata tests which can be very large.
If you are only copying the "small tests" into your IDE, then that is why you are timing out here and not in your IDE.
If you want to recreate the size of the full kata tests to see the performance of your code in your own IDE, then randomly generate a string of length
5000000
consisting of>, <, and .
and see how long it takes on your PC.hmm i think your solution is not O(n) thats why its failing the big tests...
Yeah, generating is being a weird bottleneck (somehow using numpy is slower in this environment?!?), so I changed the random tests to make its time similar to the time i got from JS, so maybe now you can? It depends on how good is the performance of your solution.