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.
compare to your solution
& leave a comment!
Great solution
Could be less than O(n²)... but still nice one
Nice one!
clean
Best solution
Nice one but check mine
x is not False, is always True (only in case when x == False)... it is useful in the case when 'arr' contains True/False .
For example :
sorted([1, 0, 1, 2,False, 0, 1, 3], key= lambda x: x==0)
-->[1, 1, 2, 1, 3, 0, False, 0]
but
sorted([1, 0, 1, 2,False, 0, 1, 3], key= lambda x: x==0 and x is not False)
-->[1, 1, 2, False, 1, 3, 0, 0]
Hope this helps!
isinstance has no need here
nice soloution