variable if we need it in future or for other calculation but if not them just returning it works. -1 is to reduce the size of stack?
From the outset it seems like it's doing the same thing, I'm not sure if there's any performance difference list is used here to implement the stack, self.stack[-1] is just accessing the last item
Обсуждают сегодня