penalty = (games) => {
const sorted = sortedGames(games);
const topAvg = sorted.slice(-2).reduce((a, n) => a + parseInt(n, 10), 0) / 2;
const bottomAvg =
sorted.slice(0, 2).reduce((a, n) => a + parseInt(n, 10), 0) / 2;
return Math.floor(topAvg - bottomAvg);
}