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.
The second slice is taken only once during the whole execution process, and having an additional
O(n)
operation in anO(n^2)
algorithm doesn't really change anything.len
is O(1)...I have haters? thats cool.
thx for the snippet
There is an upper limit of occurrence for the highest possible value. So we are taking the first n of the sorted elements. The highest possible value can be in the original array more times before other smaller numbers which should be accepted instead.
I just learned of Python's built in "hex" function and was originally planning to use this, but am also simultaneously working on a solution that is hard coded. Unfortunately, it's just going to appear a little messy with me having to specify conditions regarding the Hex table.