Valid Parentheses Stack Leetcode Problems Python