SPCEXM Space Exam IUPC Plinth 2020
Editorialist: Kabeer Seth
Basic looping, Arrays
Count number of above-average people, a person is considered above-average if he/she obtains above-average marks in at least one of the exams.
Create an array of size N, initialize it with all 0’s, arr[i] contains count of exams for which ith person obtained above-average marks.
Now iterate over each exam find the average, and then iterate over it again to find above-average people and increase their arr[i] by one.
The output will be the number of non-zero entries of arr.
Alternatively, you can use maps/dictionaries to maintain above-average people
Author’s solution can be found here .