One line solution. Beats 90%
python\nclass Solution:\n    def maximumHappinessSum(self, happiness: List[int], k: int) -> int:\n        happiness.sort(reverse=True)\n\n        ans = 0\n     
```python\nclass Solution:\n    def maximumHappinessSum(self, happiness: List[int], k: int) -> int:\n        happiness.sort(reverse=True)\n\n        ans = 0\n        for i in range(k):\n            ans += max(0, happiness[i] - i)\n\n        return ans\n```\n\n```python\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```
['Sorting', 'Python3']