1626. Best Team With No Conflicts
https://leetcode.com/problems/best-team-with-no-conflicts
Description
You are the manager of a basketball team. For the upcoming tournament, you want to choose the team with the highest overall score. The score of the team is the sum of scores of all the players in the team.
However, the basketball team is not allowed to have conflicts. A conflict exists if a younger player has a strictly higher score than an older player. A conflict does not occur between players of the same age.
Given two lists, scores
and ages
, where each scores[i]
and ages[i]
represents the score and age of the ith
player, respectively, return the highest overall score of all possible basketball teams.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= scores.length, ages.length <= 1000
scores.length == ages.length
1 <= scores[i] <= 106
1 <= ages[i] <= 1000
ac
Last updated