the fastest in dart
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n  int maxProfitAssignment(List<int> difficulty, List<int> profit, List<int> worker) {\n    List<List<int>> infos = [];\n    for (int i = 0; i < difficulty.length; i++) {\n      infos.add([difficulty[i], profit[i]]);\n    }\n    infos.sort((a, b) => a[0] - b[0]);\n    \n    List<List<int>> maxProfitForDifficulty = [];\n    int maxp = 0;\n    for (List<int> info in infos) {\n      int d = info[0], p = info[1];\n      maxp = maxp > p ? maxp : p;\n      maxProfitForDifficulty.add([d, maxp]);\n    }\n    \n    int totalProfit = 0;\n    for (int w in worker) {\n      int ind = binarySearch(maxProfitForDifficulty, w);\n      if (ind >= 0 && w >= maxProfitForDifficulty[ind][0]) {\n        totalProfit += maxProfitForDifficulty[ind][1];\n      }\n    }\n    return totalProfit;\n  }\n  \n  int binarySearch(List<List<int>> list, int target) {\n    int left = 0, right = list.length - 1;\n    while (left <= right) {\n      int mid = left + (right - left) ~/ 2;\n      if (list[mid][0] <= target) {\n        left = mid + 1;\n      } else {\n        right = mid - 1;\n      }\n    }\n    return right;\n  }\n}\n\n```
['Dart']