@@ -0,0 +1,835 @@
+#!/usr/bin/python%0A# coding:utf8%0A%0A'''%0A@author: shaoyuliang%0A@contact: mshao@splunk.com%0A@since: 7/16/14%0A%0A'''%0A%0A# https://oj.leetcode.com/problems/valid-parentheses/%0A%0Aclass Solution:%0A    # @return a boolean%0A    def isValid(self, s):%0A        brackets = %5B%5D%0A        for c in s:%0A            if c in ('(', ')', '%7B', '%7D', '%5B', '%5D'):%0A                brackets.append(c)%0A%0A        rights = %5B%5D%0A        while brackets:%0A            c = brackets.pop(0)%0A            if c in ('(', '%7B', '%5B'):%0A                rights.append(c)%0A            else:%0A                if not rights or (rights%5B-1%5D, c) not in (('(', ')'), ('%7B', '%7D'), ('%5B', '%5D')):%0A                    return False%0A                else:%0A                    rights.pop(len(rights) - 1)%0A        if rights:%0A            return False%0A        else:%0A            return True%0A%0A%0Aprint Solution().isValid('()')%0A%0A

add the solution