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.
result[:-1] means start from the end of the string and go one step backward
Accepting negative indices is a Python feature.
Why?
This is the way of doing it
I don't think convoluting the logic by introducing unecessary structures would be considered proper; unless you strongly suspected that you would in fact need to know what was pushed later on, and didn't want to have to make large changes later.
I would add len(self) for correctness.
But it is better to use the stack for more correct logic.
This comment is hidden because it contains spoiler information about the solution