comefrom: <garvit244>1011_1.py
code: def shipWithinDays( weights, D):
      high, low = sum(weights)+1, max(weights)
      
      while(low < high):
          mid = (high+low)/2
          temp_left = mid
          packet_at_left = D-1
          for weight in weights:
              if weight <= mid:
                  if temp_left < weight:
                      if packet_at_left == 0:
                          low = mid+1
                          break
                      packet_at_left -= 1
                      temp_left = mid-weight
                  else:
                      temp_left -= weight
          else:
              high = mid
              
      return low
masked: def sample_funcname ( var_0 , var_1 ) :
      var_2 , var_3 = sum ( var_0 ) + 1 , max ( var_0 )
      while ( var_3 < var_2 ) :
          var_4 = ( var_2 + var_3 ) / 2
          var_5 = var_4
          var_6 = var_1 - 1
          for var_7 in var_0 :
              if var_7 <= var_4 :
                  if var_5 < var_7 :
                      if var_6 == 0 :
                          var_3 = var_4 + 1
                          break
                      var_6 -= 1
                      var_5 = var_4 - var_7
                  else :
                      var_5 -= var_7
          else :
              var_2 = var_4
      return var_3
  