← All problems

IPO (maximize capital with k projects)

Hard heapsgreedy LeetCode ↗
Pick up to k projects to maximize final capital; each needs min capital and yields profit.

Hints (0/3 revealed)

Log in to reveal hints progressively.

Complexity

Time O(n log n), Space O(n)

Common pitfalls

  • Re-scanning affordable projects each round O(kn)
  • Taking projects in requirement order only

Your solution

Log in to save your code and track progress.