Leetcode Monotonic Stack Python Programs Using Conditional Statements