GO || Binary Search
Code\n\ntype Work struct {\n    difficulty int\n    profit int\n}\n\nfunc maxProfitAssignment(difficulty []int, profit []int, worker []int) int {\n    works := 
# Code\n```\ntype Work struct {\n    difficulty int\n    profit int\n}\n\nfunc maxProfitAssignment(difficulty []int, profit []int, worker []int) int {\n    works := []Work{}\n    for i := 0 ; i<len(profit) ; i++{\n        currentDifficulty := difficulty[i]\n        currentProfit := profit[i]\n        works = append(works , Work{difficulty:currentDifficulty , profit:currentProfit})\n    }\n\n    sort.Slice(works, func(i, j int) bool {\n        if works[i].difficulty == works[j].difficulty{\n            return works[i].profit > works[j].profit\n        }\n        return works[i].difficulty < works[j].difficulty\n    })\n\n\n\tmaxProfit := make([]int, len(profit))\n\tmaxProfit[0] = works[0].profit\n\tfor i := 1; i < len(profit); i++ {\n\t\tmaxProfit[i] = max(maxProfit[i-1], works[i].profit)\n\t}\n\n    resp := 0\n    for _, people := range worker {\n        resp += binarySearch(works , people , maxProfit)\n    }\n    return resp\n}\n\nfunc binarySearch(task []Work , people int , maxProfit[]int) int {\n    left , right := 0 , len(task)-1\n    resp := 0\n    for left <= right {\n        mid := left + (right-left) / 2 \n\n        if people >= task[mid].difficulty{\n            resp = max(resp , maxProfit[mid])\n            left = mid+1\n        } else {\n            right = mid -1\n        }\n    }\n    return resp\n}\n\nfunc max(a,b int) int {\n    if a > b {\n        return a\n    }\n    return b\n}\n```
['Go']