Another day another 1 liner
Intuition\n Describe your first thoughts on how to solve this problem. \n## Greeeeeeedyyyy\n\n\n# Approach\n Describe your approach to solving the problem. \n- 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n## Greeeeeeedyyyy\n![Greeeeeeedyyyy](https://assets.leetcode.com/users/images/1ca0da4b-5bbd-43bc-9115-2290b187bb5d_1715279673.645965.gif)\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n- sort them in decreasing order\n- slice em from 0 to k \n- calculate the sum of all numbers in sliced array and reduce them by i or take 0 if numnber is negative\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(NlogN)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\nO(N)\n# Code\n```\n/**\n * @param {number[]} happiness\n * @param {number} k\n * @return {number}\n */\nvar maximumHappinessSum = function (happiness, k) {\n\n    return happiness.sort((a, b) => b - a).slice(0, k).reduce((ac, n, i) => ac + Math.max(n-i,0), 0)\n\n};\n```\n\n\n\n![upvote](https://assets.leetcode.com/users/images/b1e4af48-4da1-486c-bc97-b11ae02febd0_1696186577.992237.jpeg)\n\n
['Greedy', 'Sorting', 'JavaScript']