IPO (Maximise Capital)
You may complete at most k projects. Project i needs at least capital[i] to start and adds profits[i] to your capital when finished. Starting with w capital, print the maximum capital you can end with.
Constraints
1 <= n <= 10^5 0 <= k <= 10^5 0 <= profits[i], capital[i], w <= 10^9
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.