Beats 97% users... Trust this code guys
\n\n# Code\n\nclass T {\n  public int pro;\n  public int cap;\n  public T(int pro, int cap) {\n    this.pro = pro;\n    this.cap = cap;\n  }\n}\n\nclass Solutio
\n\n# Code\n```\nclass T {\n  public int pro;\n  public int cap;\n  public T(int pro, int cap) {\n    this.pro = pro;\n    this.cap = cap;\n  }\n}\n\nclass Solution {\n  public int findMaximizedCapital(int k, int W, int[] Profits, int[] Capital) {\n    Queue<T> minHeap = new PriorityQueue<>((a, b) -> a.cap - b.cap);\n    Queue<T> maxHeap = new PriorityQueue<>((a, b) -> b.pro - a.pro);\n\n    for (int i = 0; i < Capital.length; ++i)\n      minHeap.offer(new T(Profits[i], Capital[i]));\n\n    while (k-- > 0) {\n      while (!minHeap.isEmpty() && minHeap.peek().cap <= W)\n        maxHeap.offer(minHeap.poll());\n      if (maxHeap.isEmpty())\n        break;\n      W += maxHeap.poll().pro;\n    }\n\n    return W;\n  }\n}\n```
['Python', 'C++', 'Java', 'Python3']