[Java] Easy solution using max heap
java\nclass Solution {\n    public int findMaximizedCapital(int k, int w, final int[] profits, final int[] capital) {\n        final int n = profits.length;\n  
```java\nclass Solution {\n    public int findMaximizedCapital(int k, int w, final int[] profits, final int[] capital) {\n        final int n = profits.length;\n        final int[][] projects = new int[n][2];\n\n        for(int i = 0; i < n; ++i) {\n            projects[i][0] = capital[i];\n            projects[i][1] = profits[i];\n        }\n\n        Arrays.sort(projects, (a, b) -> a[0] - b[0]);\n\n        final PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());\n\n        int idx = 0;\n\n        while(k-- > 0) {\n            while(idx < n && projects[idx][0] <= w)\n                maxHeap.offer(projects[idx++][1]);\n\n            if(maxHeap.isEmpty())\n                break;\n\n            w += maxHeap.poll();\n        }\n\n        return w;\n    }\n}\n```
['Java']