Count Teams Outscoring a Target Team
Problem statement
matches[i] = [homeTeam, awayTeam] and scores[i] = [homeGoals, awayGoals]. Every team appears in exactly one match.
Return how many teams scored strictly more goals than targetTeam.
Function
countTeamsOutscoring(matches: String[][], scores: int[][], targetTeam: String) → intExamples
Example 1
matches = [["Red","Blue"],["Green","Yellow"],["Orange","Violet"]]scores = [[0,1],[2,5],[0,0]]targetTeam = "Blue"return = 2Blue scored one; Green and Yellow scored more.
Constraints
- Match and score arrays have equal length.
- The target team appears exactly once.