comefrom: <doocs>2381.Shifting Letters II_1.py
code: def shiftingLetters( s: str, shifts: List[List[int]]) -> str:
      n = len(s)
      d = [0] * (n + 1)
      for i, j, v in shifts:
          if v == 0:
              v = -1
          d[i] += v
          d[j + 1] -= v
      for i in range(1, n + 1):
          d[i] += d[i - 1]
      return ''.join(
          chr(ord('a') + (ord(s[i]) - ord('a') + d[i] + 26) % 26) for i in range(n)
      )
masked: def sample_funcname ( var_0 : str , var_2 : List [ List [ int ] ] ) -> str :
      var_6 = len ( var_0 )
      var_9 = [ 0 ] * ( var_6 + 1 )
      for var_10 , var_11 , var_12 in var_2 :
          if var_12 == 0 :
              var_12 = - 1
          var_9 [ var_10 ] += var_12
          var_9 [ var_11 + 1 ] -= var_12
      for var_10 in range ( 1 , var_6 + 1 ) :
          var_9 [ var_10 ] += var_9 [ var_10 - 1 ]
      return ''.join ( chr ( ord ( 'a' ) + ( ord ( var_0 [ var_10 ] ) - ord ( 'a' ) + var_9 [ var_10 ] + 26 ) % 26 ) for var_10 in range ( var_6 ) )
  