Very Simple (Greedy) Java Solution using two PriorityQueues
The idea is each time we find a project with max profit and within current capital capability.\nAlgorithm:\n1. Create (capital, profit) pairs and put them into 
The idea is each time we find a project with ```max``` profit and within current capital capability.\nAlgorithm:\n1. Create (capital, profit) pairs and put them into PriorityQueue ```pqCap```. This PriorityQueue sort by capital increasingly.\n2. Keep polling pairs from ```pqCap``` until the project out of current capital capability. Put them into \nPriorityQueue ```pqPro``` which sort by profit decreasingly.\n3. Poll one from ```pqPro```, it's guaranteed to be the project with ```max``` profit and within current capital capability. Add the profit to capital ```W```.\n4. Repeat step 2 and 3 till finish ```k``` steps or no suitable project (pqPro.isEmpty()).\n\nTime Complexity: For worst case, each project will be inserted and polled from both PriorityQueues once, so the overall runtime complexity should be ```O(NlgN)```, N is number of projects.\n\n```\npublic class Solution {\n    public int findMaximizedCapital(int k, int W, int[] Profits, int[] Capital) {\n        PriorityQueue<int[]> pqCap = new PriorityQueue<>((a, b) -> (a[0] - b[0]));\n        PriorityQueue<int[]> pqPro = new PriorityQueue<>((a, b) -> (b[1] - a[1]));\n        \n        for (int i = 0; i < Profits.length; i++) {\n            pqCap.add(new int[] {Capital[i], Profits[i]});\n        }\n        \n        for (int i = 0; i < k; i++) {\n            while (!pqCap.isEmpty() && pqCap.peek()[0] <= W) {\n                pqPro.add(pqCap.poll());\n            }\n            \n            if (pqPro.isEmpty()) break;\n            \n            W += pqPro.poll()[1];\n        }\n        \n        return W;\n    }\n}\n```
[]