Editorial for LCC '23 Contest 1 J2 - Costume Scores
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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
For both subtasks, iterate through the array of integers, adding one to Shane's placement for every score greater than Shane's score, while keeping track of the minimum and maximum values.
Time Complexity:
Alternatively, sort the array of integers and binary search for Shane's placement, with index and index being the maximum and minimum values.
Time Complexity:
Comments