Stack Class
In this exercise, you are tasked with implementing a Stack
class. This class should be able to:
Push an item onto the stack (
push()
method).Pop an item from the stack (
pop()
method) - should remove and return the item.Check if the stack is empty (
is_empty()
method) - should return a boolean.
Input | Output |
---|---|
| 3 False 2 1 True |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB