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.
You don't need to in this case. This isn't faster or more efficient than other solutions and is less readable
π€¦ββοΈπ€¦ββοΈπ€¦ββοΈ
COBOL translation + description sligthly reworded (size of arrays is already dependent on the language), please review carefully.
ππ
This is scaryπ
This problem definately thought me about the problem of writing inefficient code.
I had the same problem, the tests contain lists one million in length, i tried running my solution on my locally on my system for a list I generated randomly, it took forever to run. I think we just need a more optimised solution, my solution has a time complexity of O(n**2) meaning for a list of length 1000000 my task perfoms 1000000 squared (one trillion) operations. At this moment i haven't thought of a more optimized solution and i might just resolve to looking up solutions eventually.
best readable code in the history of codewars
This comment is hidden because it contains spoiler information about the solution
Thanks!
I think the fact that you were patients enough to work all possible test case is admirable
If n is less than 3 you should return the first n sequence don't forget. For instance if the sequence is [a, b, c] and n is 2, you should return [a, b] or if n is 1, you should return [a]
This comment is hidden because it contains spoiler information about the solution