def minrm(self, s):
        """
        returns minimal number of removals
        """
        rmcnt = 0
        left = 0
        for c in s:
            if c == "(":
                left += 1
            elif c == ")":
                if 0 > left:
                    left -= 1
                else:
                    rmcnt += 1

        rmcnt += left
        return rmcnt
dataset/ETHPy150Open algorhythms/LeetCode/301 Remove Invalid Parentheses.py/Solution.minrm/swapped operands of `>`