greedy solution using 2 priority queue
\n//pair defined\ntypedef pair<int,int> p;\nclass Solution {\npublic:\n    int findMaximizedCapital(int k, int W, vector<int>& Profits, vector<int>& Capital) {\
```\n//pair defined\ntypedef pair<int,int> p;\nclass Solution {\npublic:\n    int findMaximizedCapital(int k, int W, vector<int>& Profits, vector<int>& Capital) {\n\t    //create minHeap to sort on the basis of capital\n        priority_queue<p, vector<p>, greater<p>> minHeap;\n\t\t//create maxHeap to sort on the basis of profit\n        priority_queue<p> maxHeap;\n\t\t//push all the capitals and profit to capital priority queue\n        for(int i=0;i<Profits.size();i++){\n            minHeap.push(make_pair(Capital[i], Profits[i]));\n        }\n\t\t//push suitable profits and capital to profit priority queue from capital priority queue\n        for(int i=0;i<k;i++){\n            while(minHeap.size()>0 and minHeap.top().first<=W){\n                pair<int,int> p=minHeap.top();\n                maxHeap.push(make_pair(p.second,p.first));\n                minHeap.pop();\n            }\n            if(maxHeap.size()>0){\n                W+=maxHeap.top().first;\n                maxHeap.pop();\n            }\n        }\n        return W;\n    }\n};\n```
['C', 'Heap (Priority Queue)', 'C++']