Given a list of the scores of different students,
items
, whereitems[i] = [IDi, scorei]
represents one score from a student withIDi
, calculate each student’s top five average.Return the answer as an array of pairs
result
, whereresult[j] = [IDj, topFiveAveragej]
represents the student withIDj
and their top five average. Sortresult
byIDj
in increasing order.A student’s top five average is calculated by taking the sum of their top five scores and dividing it by
5
using integer division.
1 | class Solution { |