Simple || Easy to Understand
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    class Project {
        private int capital;
        private int profit;

        Project(int capital, int profit) {
            this.capital = capital;
            this.profit = profit;
        }
    }

    public int findMaximizedCapital(int k, int w, int[] profits, int[] capital) {
        int n = profits.length;
        List<Project> projects = new ArrayList<>();

        for(int i = 0; i < n; i++) projects.add(new Project(capital[i], profits[i]));

        //sorting projects by capital
        Collections.sort(projects, (a, b) -> a.capital - b.capital);

        //max heap
        PriorityQueue<Integer> heap = new PriorityQueue<>((a, b) -> b - a);

        for(int i = 0, j = 0; i < k; i++) {
            while(j < n && projects.get(j).capital <= w) {
                heap.add(projects.get(j).profit);
                j++;
            }

            if(heap.isEmpty()) break;

            w += heap.poll();
        }

        return w;
    }
}
```
['Java']