Leetcode Monotonic Stack Python Programming