Back to problems

Team Ranking Based on Scores and Goal Difference

Algorithm · Capital One · Medium

A tournament uses the following point system: a victory earns 3 points, a tied match earns 1 point, and a defeat earns no points. When teams finish level on points, order them by goal differential, calculated as goals scored minus goals allowed. If both points and goal differential are equal, rank the team with the lower index higher. Given the wins, draws, scored, and conceded arrays, return the indices of the teams ranked first and second. The expected time complexity is…

Checking your access…