[Python3] Sort + Heap + Take Sum - Simple Solution
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\n##### 1. Sort\n```\nclass Solution:\n    def maximumHappinessSum(self, happiness: List[int], k: int) -> int:\n        happiness.sort(reverse=True)\n        res = 0\n        for i in range(k):\n            res += max(0, happiness[i] - i)\n        return res\n```\n- Time complexity: $$O(NlogN)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(N)$$\n\n\n##### 2. Heap\n```\nclass Solution:\n    def maximumHappinessSum(self, happiness: List[int], k: int) -> int:\n        for i in range(len(happiness)): happiness[i] = -happiness[i]\n        heapq.heapify(happiness)\n        res = 0\n        for i in range(k):\n            res += max(0, -heapq.heappop(happiness) - i)\n        return res\n```\n- Time complexity: $$O(N + klog(N))$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n\n##### 3. Pythonic 1-line\n\n```\nclass Solution:\n    def maximumHappinessSum(self, happiness: List[int], k: int) -> int:\n        return sum(max(0, h - i) for i, h in enumerate(sorted(happiness, reverse=True)[:k]))\n```\n\n- Time complexity: $$O(NlogN)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(N)$$
['Sorting', 'Heap (Priority Queue)', 'Python3']