Dart using PriorityQueues
Code\n\nimport \'package:collection/collection.dart\';\n\ntypedef proCap = ({int capital, int profit});\n\nclass Solution {\n  int findMaximizedCapital(int k, i
# Code\n```\nimport \'package:collection/collection.dart\';\n\ntypedef proCap = ({int capital, int profit});\n\nclass Solution {\n  int findMaximizedCapital(int k, int w, List<int> profits, List<int> capital) {\n    final pqCap = PriorityQueue<proCap>((a, b) => a.capital - b.capital);\n    final pqPro = PriorityQueue<proCap>((a, b) => b.profit - a.profit);\n\n    for (int i = 0; i < profits.length; i++) {\n      pqCap.add((capital: capital[i], profit: profits[i]));\n    }\n\n    for (int i = 0; i < k; i++) {\n      while (pqCap.isNotEmpty && pqCap.first.capital <= w) {\n        pqPro.add(pqCap.removeFirst());\n      }\n\n      if (pqPro.isEmpty) break;\n\n      w += pqPro.removeFirst().profit;\n    }\n\n    return w;\n  }\n}\n```
['Dart']