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_3 = 0
      var_4 = [ 0 ] * ( len ( var_0 ) + 1 )
      var_5 = 0
      for var_6 , var_7 in zip ( var_0 , var_1 ) :
          var_4 [ var_5 + 1 ] = var_4 [ var_5 ]
          if var_7 == 0 :
              var_3 += var_6
          else :
              var_4 [ var_5 + 1 ] += var_6
          var_5 += 1
      var_8 = var_3 + var_4 [ var_2 ]
      for var_5 in range ( var_2 + 1 , len ( var_4 ) ) :
          var_9 = var_3 + var_4 [ var_5 ] - var_4 [ var_5 - var_2 ]
          var_8 = max ( var_8 , var_9 )
      return var_8
  