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.
I think
arr1 = arr.copy()
is more pythonic.Yes, this mutates the input.
arr1 = arr
does not produce a newlist
, it just makes a reference to it. So, when you emptyarr1
, you are emptyingarr
. Instead, usearr1 = arr[:]
, which will make a newlist
.In the instructions it states
When various orders have the same price, their quantities are aggregated and all of those orders appear at the same level in the orderbook.
Good!
are you perchance modifying the input?