💯JAVA Solution Explained in HINDI
https://youtu.be/Nsl32H-VYLM\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F Also, please do upvote 
https://youtu.be/Nsl32H-VYLM\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F Also, please do upvote the solution if you liked it.\n\n# Subscribe :- [ReelCoding](https://www.youtube.com/@reelcoding?sub_confirmation=1)\n\nSubscribe Goal:- 400\nCurrent Subscriber:- 355\n\n# Complexity\n- Time complexity: O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public long maximumHappinessSum(int[] happiness, int k) {\n        long ans = 0, dec = 0;\n        Arrays.sort(happiness);\n\n        for (int i = happiness.length - 1; i >= happiness.length - k; i--) {\n            ans += Math.max(0, happiness[i] - dec);\n            dec++;\n        }\n\n        return ans;\n    }\n}\n```
['Java']