comefrom: <garvit244>1052_1.py
code: def maxSatisfied( customers, grumpy, X):
      result = 0
      
      prefix_sum = [0]*(len(customers)+1)
      index = 0
      for customer, grump in zip(customers, grumpy):
          prefix_sum[index+1] = prefix_sum[index]
          if grump == 0:
              result += customer
          else:
              prefix_sum[index+1] += customer
          index += 1
      curr_max = result + prefix_sum[X]
      for index in range(X+1, len(prefix_sum)):
          temp_max = result + prefix_sum[index] - prefix_sum[index-X]
          curr_max = max(curr_max, temp_max)
      return curr_max
masked: def sample_funcname ( var_0 , var_1 , var_2 ) :
      var_4 = 0
      var_7 = [ 0 ] * ( len ( var_0 ) + 1 )
      var_8 = 0
      for var_10 , var_11 in zip ( var_0 , var_1 ) :
          var_7 [ var_8 + 1 ] = var_7 [ var_8 ]
          if var_11 == 0 :
              var_4 += var_10
          else :
              var_7 [ var_8 + 1 ] += var_10
          var_8 += 1
      var_12 = var_4 + var_7 [ var_2 ]
      for var_8 in range ( var_2 + 1 , len ( var_7 ) ) :
          var_14 = var_4 + var_7 [ var_8 ] - var_7 [ var_8 - var_2 ]
          var_12 = max ( var_12 , var_14 )
      return var_12
  