Editorial for LCC '21 Contest 1 J1 - Costume Contest


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

Author: AlanL

Since they want to remove Eric's highest score, you can add up all of the scores first, then loop through the scores once to find the maximum score, and subtract it from the sum.

Another way to do this would be to store all of the scores in an array, sort it in ascending order, and add up all of the values in the array from index 0 to index N-1.


Comments

There are no comments at the moment.