20 Valid Parentheses Leetcode Solution Python