comefrom: <garvit244>32_1.py
code: def longestValidParentheses( s):
      stack, result = [-1], 0
      
      for index in range(len(s)):
          if s[index] == '(':
              stack.append(index)
          else:
              currIndex = stack.pop()
              if currIndex == -1:
                  stack.append(index)
              else:
                  result = max(result, index-currIndex+1)
      return result
masked: def sample_funcname ( var_0 ) :
      var_2 , var_4 = [ - 1 ] , 0
      for var_7 in range ( len ( var_0 ) ) :
          if var_0 [ var_7 ] == '(' :
              var_2.append ( var_7 )
          else :
              var_11 = var_2.pop ( )
              if var_11 == - 1 :
                  var_2.append ( var_7 )
              else :
                  var_4 = max ( var_4 , var_7 - var_11 + 1 )
      return var_4
  