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.
awesome bro!
very clever use of regex. i am still a beginner in regex.
shift() will delete odd's first item and return this item.
So if x is even return x, if x is odd, get the min number from odd's first position and return it.
It's my understanding, welcome talk with me~
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Please use spoiler flag next 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
hands down the best solution. imagine finding this code in production!
More than twice as fast actually. This solution runs in
O(n)
whereas yours runs inO(n*n*(n+1)/2)
.i don't understand what's going on here? i think i should revisit array mehtods.