Each of the children have a happiness value assigned to them. One needs to select the children with maximum happiness in each turn for k turns and return the maximum sum. In each turn the happiness of the children who have not been selected reduces by 1.
Note: Happiness can't be negative at any instant
Pull Request Template
Description
3075. Maximize Happiness of Selected Children
Each of the children have a happiness value assigned to them. One needs to select the children with maximum happiness in each turn for k turns and return the maximum sum. In each turn the happiness of the children who have not been selected reduces by 1. Note: Happiness can't be negative at any instant
Topics: Arrays, Sorting, Greedy
No dependencies
Put check marks:
Have you made changes in README file ?
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
My solution got accepted on LeetCode.
Make sure all below guidelines are followed else PR will get Reject: