[DAY16]Luck Balance
1 min readOct 18, 2019
Solution: We need to record the amount of luck associated with important contests using a list. By sorting the list, we could manage to select the minimum luck that we would lose to satisfy the constraint. But integer k might be greater than the number of important contests. Which means Lena could lose all of the important contests. So we need to add a conditional judgement, if integer k is greater than the number of important contest than we just add the amount of luck associated with the important contests.