Super Simple Easy to understand JAVA SOLUTION!!!!
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public long maximumHappinessSum(int[] happiness, int k) {

        Arrays.sort(happiness);
        int reduction = 0;
        long ans = 0;


int n = happiness.length -1;
while( n>= 0 && k > 0){
 int toadd= happiness[n] - reduction;
 if(toadd >= 0){
    ans += toadd;
 }
 reduction++;
 n--;
 k--;


}

       return ans; 

        
    }
}
```
['Greedy', 'Java']