32ms C++ beats 100%
\n#define pi pair<int,int>\n#define f first\n#define s second\n\nclass Solution {\npublic:\n    \n    int findMaximizedCapital(int k, int W, vector<int>& p, vec
```\n#define pi pair<int,int>\n#define f first\n#define s second\n\nclass Solution {\npublic:\n    \n    int findMaximizedCapital(int k, int W, vector<int>& p, vector<int>& c) {\n       \n        int n = p.size();\n        vector<pair<int,int>> projects;\n        for(int i=0 ; i<n ; i++)    projects.push_back({p[i],c[i]});\n\n        sort(projects.begin(),projects.end(),[&](pi a,pi b){ return a.s<b.s;});\n        \n        priority_queue<int> pq;\n        \n        int i=0;\n        \n        while(k){\n            while(i<n && projects[i].s<=W)     \n                pq.push(projects[i++].f);\n            \n            if(!pq.empty()){\n                W += pq.top();\n                pq.pop();\n            }\n            k--;\n        }\n        \n        return W;\n    }\n};\n```
[]