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
.I must have missed it then, thanks kind stranger
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.
Hello, I am facing an issue, some python tests are expecting an output that shouldn't be possible,
on test number 'Add message 7':
the expected output is 8@6 : 3@30
but there are no buy or sell orders with this much quantity
the output should be 6@6 : 1@30
on test case number 'Cancel message 8'
the expected output is again something thats not possible with the given input.
Good!
Finally did it after like a day, my code is as ugly, long and unreadable as it could get, but finally. Great kata g964!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
are you perchance modifying the input?
This comment is hidden because it contains spoiler information about the solution