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.
Yes!!!
This comment is hidden because it contains spoiler information about the solution
While this does pass the tests, if an array is used with no stray value, this will error with an IndexError.
yes, but that's only because this is a subset of a more general problem. Let's apply the very same algo to something with a larger "alphabet" (=> larger set size), and this algo becomes suddenly
O(m*n)
(n: size of the array, m: size of the set/alphabet), which isn't linear anymore.n + 2 * n is still O(n)...
+1 me 2
Do not understand the instruction.
This comment is hidden because it contains spoiler information about the solution
Your solution isn't O(n) though
I can complete it in O(n).Reallly reduce the number of iteration.