502. IPO
維持maxheap內只有符合capital條件的profits即可
def findMaximizedCapital(self, k: int, w: int, profits: List[int], capital:
List[int]) -> int:
l = sorted([(cap, pro) for cap, pro in zip(capital, profits)])
h = []
cur_i, n = 0, len(profits)
for i in range(k):
while cur_i<n and l[cur_i][0] <= w:
heappush(h, -l[cur_i][1])
cur_i += 1
if len(h)>0:
cur_profit = heappop(h)
w -= cur_profit
return w