diff --git a/solution/2100-2199/2171.Removing Minimum Number of Magic Beans/README.md b/solution/2100-2199/2171.Removing Minimum Number of Magic Beans/README.md index 5820cd7195654..ce9037fe97a88 100644 --- a/solution/2100-2199/2171.Removing Minimum Number of Magic Beans/README.md +++ b/solution/2100-2199/2171.Removing Minimum Number of Magic Beans/README.md @@ -17,7 +17,7 @@

示例 1:

-输入:beans = [4,1,6,5]
+输入:beans = [4,1,6,5]
 输出:4
 解释:
 - 我们从有 1 个魔法豆的袋子中拿出 1 颗魔法豆。
@@ -33,7 +33,7 @@
 

示例 2:

-输入:beans = [2,10,3,2]
+输入:beans = [2,10,3,2]
 输出:7
 解释:
 - 我们从有 2 个魔法豆的其中一个袋子中拿出 2 个魔法豆。
diff --git a/solution/2900-2999/2921.Maximum Profitable Triplets With Increasing Prices II/README.md b/solution/2900-2999/2921.Maximum Profitable Triplets With Increasing Prices II/README.md
index d4687ee2c48f5..b0fbd65a7067b 100644
--- a/solution/2900-2999/2921.Maximum Profitable Triplets With Increasing Prices II/README.md	
+++ b/solution/2900-2999/2921.Maximum Profitable Triplets With Increasing Prices II/README.md	
@@ -1,4 +1,4 @@
-# [2921. Maximum Profitable Triplets With Increasing Prices II](https://leetcode.cn/problems/maximum-profitable-triplets-with-increasing-prices-ii)
+# [2921. 具有递增价格的最大利润三元组 II](https://leetcode.cn/problems/maximum-profitable-triplets-with-increasing-prices-ii)
 
 [English Version](/solution/2900-2999/2921.Maximum%20Profitable%20Triplets%20With%20Increasing%20Prices%20II/README_EN.md)
 
@@ -6,47 +6,49 @@
 
 
 
-

Given the 0-indexed arrays prices and profits of length n. There are n items in an store where the ith item has a price of prices[i] and a profit of profits[i].

+

给定长度为 n  的数组 prices 和 profits (下标从 0 开始)。一个商店有 n 个商品,第 i 个商品的价格为 prices[i],利润为 profits[i]

-

We have to pick three items with the following condition:

+

需要选择三个商品,满足以下条件:

-

If we pick items with indices i, j and k satisfying the above condition, the profit would be profits[i] + profits[j] + profits[k].

+

如果选择的商品 i, j 和 k 满足以下条件,那么利润将等于 profits[i] + profits[j] + profits[k]

-

Return the maximum profit we can get, and -1 if it's not possible to pick three items with the given condition.

+

返回能够获得的 最大利润,如果不可能满足给定条件,返回 -1

 

-

Example 1:

+ +

示例 1:

-Input: prices = [10,2,3,4], profits = [100,2,7,10]
-Output: 19
-Explanation: We can't pick the item with index i=0 since there are no indices j and k such that the condition holds.
-So the only triplet we can pick, are the items with indices 1, 2 and 3 and it's a valid pick since prices[1] < prices[2] < prices[3].
-The answer would be sum of their profits which is 2 + 7 + 10 = 19.
+输入:prices = [10,2,3,4], profits = [100,2,7,10] +输出:19 +解释:不能选择下标 i=0 的商品,因为没有下标 j 和 k 的商品满足条件。 +只能选择下标为 1、2、3 的三个商品,这是有效的选择,因为 prices[1] < prices[2] < prices[3]。 +答案是它们的利润之和,即 2 + 7 + 10 = 19。
-

Example 2:

+

示例 2:

-Input: prices = [1,2,3,4,5], profits = [1,5,3,4,6]
-Output: 15
-Explanation: We can select any triplet of items since for each triplet of indices i, j and k such that i < j < k, the condition holds.
-Therefore the maximum profit we can get would be the 3 most profitable items which are indices 1, 3 and 4.
-The answer would be sum of their profits which is 5 + 4 + 6 = 15.
+输入:prices = [1,2,3,4,5], profits = [1,5,3,4,6] +输出:15 +解释:可以选择任意三个商品,因为对于每组满足下标为 i < j < k 的三个商品,条件都成立。 +因此,能得到的最大利润就是利润和最大的三个商品,即下标为 1,3 和 4 的商品。 +答案就是它们的利润之和,即 5 + 4 + 6 = 15。
-

Example 3:

+

示例 3:

-Input: prices = [4,3,2,1], profits = [33,20,19,87]
-Output: -1
-Explanation: We can't select any triplet of indices such that the condition holds, so we return -1.
+输入:prices = [4,3,2,1], profits = [33,20,19,87]
+输出:-1
+解释:找不到任何可以满足条件的三个商品,所以返回 -1.
 

 

-

Constraints:

+ +

提示:

## 解法 diff --git a/solution/2900-2999/2923.Find Champion I/README_EN.md b/solution/2900-2999/2923.Find Champion I/README_EN.md index fdbc296f6db86..e8c259f8da96c 100644 --- a/solution/2900-2999/2923.Find Champion I/README_EN.md +++ b/solution/2900-2999/2923.Find Champion I/README_EN.md @@ -41,6 +41,7 @@ So team 1 will be the champion.
  • n == grid[i].length
  • 2 <= n <= 100
  • grid[i][j] is either 0 or 1.
  • +
  • For all i grid[i][i] is 0.
  • For all i, j that i != j, grid[i][j] != grid[j][i].
  • The input is generated such that if team a is stronger than team b and team b is stronger than team c, then team a is stronger than team c.
  • diff --git a/solution/2900-2999/2927.Distribute Candies Among Children III/README.md b/solution/2900-2999/2927.Distribute Candies Among Children III/README.md index a5ff2396e9b49..390c1a0a661f1 100644 --- a/solution/2900-2999/2927.Distribute Candies Among Children III/README.md +++ b/solution/2900-2999/2927.Distribute Candies Among Children III/README.md @@ -1,4 +1,4 @@ -# [2927. Distribute Candies Among Children III](https://leetcode.cn/problems/distribute-candies-among-children-iii) +# [2927. 将糖果分发给孩子 III](https://leetcode.cn/problems/distribute-candies-among-children-iii) [English Version](/solution/2900-2999/2927.Distribute%20Candies%20Among%20Children%20III/README_EN.md) @@ -6,29 +6,31 @@ -

    You are given two positive integers n and limit.

    +

    你被给定两个正整数 nlimit

    -

    Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies.

    +

    返回 在每个孩子得到不超过 limit 个糖果的情况下,将 n 个糖果分发给 3 个孩子的 总方法数

     

    -

    Example 1:

    + +

    示例 1:

    -Input: n = 5, limit = 2
    -Output: 3
    -Explanation: There are 3 ways to distribute 5 candies such that no child gets more than 2 candies: (1, 2, 2), (2, 1, 2) and (2, 2, 1).
    +输入:n = 5, limit = 2
    +输出:3
    +解释:有 3 种方式将 5 个糖果分发给 3 个孩子,使得每个孩子得到不超过 2 个糖果:(1, 2, 2), (2, 1, 2) 和 (2, 2, 1)。
     
    -

    Example 2:

    +

    示例 2:

    -Input: n = 3, limit = 3
    -Output: 10
    -Explanation: There are 10 ways to distribute 3 candies such that no child gets more than 3 candies: (0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) and (3, 0, 0).
    +输入:n = 3, limit = 3
    +输出:10
    +解释:有 10 种方式将 3 个糖果分发给 3 个孩子,使得每个孩子得到不超过 3 个糖果:(0, 0, 3), (0, 1, 2), (0, 2, 1), (0, 3, 0), (1, 0, 2), (1, 1, 1), (1, 2, 0), (2, 0, 1), (2, 1, 0) 和 (3, 0, 0)。
     

     

    -

    Constraints:

    + +

    提示: