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.
Guess you could just forget about return and use .get in the end of the dictionary.
You don't really need the two last items in the headers list.
No notes!
This solution is
O(4n)
when it's trivial to write anO(n)
solution that's easier to understand.updated
Sorry, i wanna add some piece...
To be more precise, good choice would be specify that the input data can be: boolean array, array of objects, array of string arrays, array of number arrays... 😕
The instructions should specify that the input array could consist of integer or string elements.
Finally a solution using a closed form expression instead of an unnecessary sum!
#11b34/3qa:0z:vV
nice one-liner
Why "poss_list = list(range(0, len(arr), 1))" instead of just "range(len(arr))"?
Why "True if n in arr else False" instead of just "n in arr"?
Your solution is basically this with unnessecary code:
return all(n in arr for n in range(len(arr))) if arr else False