C#
Code
# Code
```csharp []
public class Solution {
    public long MaximumHappinessSum(int[] happiness, int k) {
          happiness = happiness.OrderByDescending(x => x).ToArray();
        long sum = 0;
        int decrease = 0;

        for (int i = 0; i < k; i++)
        {
             if(happiness[i] - decrease > 0)
             sum += happiness[i] - decrease;
            decrease++;
        }
        return sum;
    }
}
```
['C#']