def maxDepth(self, s):
    maxD = (- float('inf'))
    currD = 0
    for ch in s:
        if (ch not in ['(', ')']):
            continue
        if (ch == '('):
            currD += 1
        else:
            maxD = max(maxD, currD)
            currD -= 1
    return (maxD if (maxD != (- float('inf'))) else currD)
def maxDepth(self, s):
    maxD = (- float('inf'))
    currD = 0
    for ch in s:
        if (ch not in ['(', ')']):
            continue
        if (ch == '('):
            currD += 1
        else:
            maxD = max(maxD, currD)
            currD -= 1
    return (maxD if (maxD != (- float('inf'))) else currD)