Stack Using Arraylist Leetcode Python