comefrom: <qiyuangong>581_Shortest_Unsorted_Continuous_Subarray_3.py
code: def findUnsortedSubarray( nums):
      smin = 2 ** 31 -1
      smax = -2 ** 31
      flag = False
      for i in range(1, len(nums)):
          if nums[i] < nums[i-1]:
              flag = True
          if flag:
              smin = min(smin, nums[i])
      flag = False
      for i in range(len(nums)-2, -1, -1):
          if nums[i] > nums[i+1]:
              flag = True
          if flag:
              smax = max(smax, nums[i])
      for l in range(len(nums)):
          if smin < nums[l]:
              break
      for r in range(len(nums)-1, -1, -1):
          if smax > nums[r]:
              break
      if r > l:
          return r - l + 1
      return 0
masked: def sample_funcname ( var_0 ) :
      var_1 = 2 ** 31 - 1
      var_2 = - 2 ** 31
      var_3 = False
      for var_4 in range ( 1 , len ( var_0 ) ) :
          if var_0 [ var_4 ] < var_0 [ var_4 - 1 ] :
              var_3 = True
          if var_3 :
              var_1 = min ( var_1 , var_0 [ var_4 ] )
      var_3 = False
      for var_4 in range ( len ( var_0 ) - 2 , - 1 , - 1 ) :
          if var_0 [ var_4 ] > var_0 [ var_4 + 1 ] :
              var_3 = True
          if var_3 :
              var_2 = max ( var_2 , var_0 [ var_4 ] )
      for var_5 in range ( len ( var_0 ) ) :
          if var_1 < var_0 [ var_5 ] :
              break
      for var_6 in range ( len ( var_0 ) - 1 , - 1 , - 1 ) :
          if var_2 > var_0 [ var_6 ] :
              break
      if var_6 > var_5 :
          return var_6 - var_5 + 1
      return 0
  