Easy Python Solution
Code\n\nclass Solution:\n    def maximumHappinessSum(self, h: List[int], k: int) -> int:\n        count = 0\n        g = 0\n        h.sort()\n        for i in r
# Code\n```\nclass Solution:\n    def maximumHappinessSum(self, h: List[int], k: int) -> int:\n        count = 0\n        g = 0\n        h.sort()\n        for i in range(len(h)-1,-1,-1):\n            if k==0:\n                break\n            else:\n                k-=1\n                a = h[i] - g\n                if a>=0:\n                    count+=h[i] - g\n                    g+=1\n                else:\n                    count+=0\n                    g+=1\n        return count\n                \n                \n        \n```
['Python3']