|
1 | | -<h2><a href="https://leetcode.com/problems/best-team-with-no-conflicts/">1626. Best Team With No Conflicts</a></h2><h3>Medium</h3><hr><div><p>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 <strong>sum</strong> of scores of all the players in the team.</p> |
| 1 | +<h2><a href="https://leetcode.com/problems/best-team-with-no-conflicts">1748. Best Team With No Conflicts</a></h2><h3>Medium</h3><hr><p>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 <strong>sum</strong> of scores of all the players in the team.</p> |
2 | 2 |
|
3 | 3 | <p>However, the basketball team is not allowed to have <strong>conflicts</strong>. A <strong>conflict</strong> exists if a younger player has a <strong>strictly higher</strong> score than an older player. A conflict does <strong>not</strong> occur between players of the same age.</p> |
4 | 4 |
|
|
7 | 7 | <p> </p> |
8 | 8 | <p><strong class="example">Example 1:</strong></p> |
9 | 9 |
|
10 | | -<pre><strong>Input:</strong> scores = [1,3,5,10,15], ages = [1,2,3,4,5] |
| 10 | +<pre> |
| 11 | +<strong>Input:</strong> scores = [1,3,5,10,15], ages = [1,2,3,4,5] |
11 | 12 | <strong>Output:</strong> 34 |
12 | 13 | <strong>Explanation:</strong> You can choose all the players. |
13 | 14 | </pre> |
14 | 15 |
|
15 | 16 | <p><strong class="example">Example 2:</strong></p> |
16 | 17 |
|
17 | | -<pre><strong>Input:</strong> scores = [4,5,6,5], ages = [2,1,2,1] |
| 18 | +<pre> |
| 19 | +<strong>Input:</strong> scores = [4,5,6,5], ages = [2,1,2,1] |
18 | 20 | <strong>Output:</strong> 16 |
19 | 21 | <strong>Explanation:</strong> It is best to choose the last 3 players. Notice that you are allowed to choose multiple people of the same age. |
20 | 22 | </pre> |
21 | 23 |
|
22 | 24 | <p><strong class="example">Example 3:</strong></p> |
23 | 25 |
|
24 | | -<pre><strong>Input:</strong> scores = [1,2,3,5], ages = [8,9,10,1] |
| 26 | +<pre> |
| 27 | +<strong>Input:</strong> scores = [1,2,3,5], ages = [8,9,10,1] |
25 | 28 | <strong>Output:</strong> 6 |
26 | 29 | <strong>Explanation:</strong> It is best to choose the first 3 players. |
27 | 30 | </pre> |
|
35 | 38 | <li><code>1 <= scores[i] <= 10<sup>6</sup></code></li> |
36 | 39 | <li><code>1 <= ages[i] <= 1000</code></li> |
37 | 40 | </ul> |
38 | | -</div> |
|
0 commit comments