Beats 97% users.. highly reliable code
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    def maxProfitAssignment(self, difficulty: List[int], profit: List[int], worker: List[int]) -> int:\n        max_profit_for_difficulty = []\n        infos = list(zip(difficulty, profit))\n        infos.sort(key = lambda x: x[0])\n        maxp = 0\n        for info in infos:\n            d, p = info\n            maxp = max(maxp, p)\n            max_profit_for_difficulty.append((d,maxp))\n        \n        def binsearch(L, upperbound):\n            i = 0 \n            j = len(L) - 1\n            while i<j:\n                mid = (i+j)//2 + 1\n                if L[mid][0] <= upperbound:\n                    i = mid\n                else:\n                    j = mid - 1\n            return i\n        \n        totalprof = 0\n        for w in worker:\n            ind = binsearch(max_profit_for_difficulty, w)\n            d, p = max_profit_for_difficulty[ind]\n            if w >= d:\n                totalprof += p\n        return totalprof\n\n```
['C', 'Python', 'C++', 'Java', 'Python3']