As reported: Goldman Sachs SDE Analyst coding round (USA, 2026): the High Five problem, with the focus on optimisation and edge cases; the other question was Median of Two Sorted Arrays.
Given items[i] = [id, score], compute each student's average of their top five scores using integer division. Return [id, average] pairs sorted by id.
This is LeetCode 1086 — High Five.
Example 1
items = [[1,91],[1,92],[2,93],[2,97],[1,60],[2,77],[1,65],[1,87],[1,100],[2,100],[2,76]]
-> [[1,87],[2,88]]
Example 2
items = [[1,100],[7,100],[1,100],[7,100],[1,100],[7,100],[1,100],[7,100],[1,100],[7,100]]
-> [[1,100],[7,100]]
Constraints: 1 ≤ items.length ≤ 1000; 1 ≤ id ≤ 1000; 0 ≤ score ≤ 100; every student has at least five scores.
Code runner format: one JSON value per line: items (LeetCode's test-case format). Implement highFive(items); the harness prints the result as JSON.