diff --git a/solution/0200-0299/0263.Ugly Number/README.md b/solution/0200-0299/0263.Ugly Number/README.md
index 2080b6f45bc06..1b160e0f81161 100644
--- a/solution/0200-0299/0263.Ugly Number/README.md
+++ b/solution/0200-0299/0263.Ugly Number/README.md
@@ -31,7 +31,7 @@
输入:n = 14
输出:false
-解释:14 不是丑数,因为它包含了另外一个质因数 7。
+解释:14 不是丑数,因为它包含了另外一个质因数 7
。
diff --git a/solution/0300-0399/0387.First Unique Character in a String/README.md b/solution/0300-0399/0387.First Unique Character in a String/README.md
index 82ec83e524ffa..70818329b69fd 100644
--- a/solution/0300-0399/0387.First Unique Character in a String/README.md
+++ b/solution/0300-0399/0387.First Unique Character in a String/README.md
@@ -188,7 +188,7 @@ class Solution {
return -1;
}
}
-```
+```
### **...**
diff --git a/solution/0300-0399/0387.First Unique Character in a String/README_EN.md b/solution/0300-0399/0387.First Unique Character in a String/README_EN.md
index e87f4b0b42d6a..7f4b6c8ce1837 100644
--- a/solution/0300-0399/0387.First Unique Character in a String/README_EN.md
+++ b/solution/0300-0399/0387.First Unique Character in a String/README_EN.md
@@ -157,7 +157,7 @@ class Solution {
return -1;
}
}
-```
+```
### **...**
diff --git a/solution/0600-0699/0605.Can Place Flowers/README_EN.md b/solution/0600-0699/0605.Can Place Flowers/README_EN.md
index ffb414f3101b4..6770c350022e6 100644
--- a/solution/0600-0699/0605.Can Place Flowers/README_EN.md
+++ b/solution/0600-0699/0605.Can Place Flowers/README_EN.md
@@ -6,7 +6,7 @@
You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots.
-Given an integer array flowerbed
containing 0
's and 1
's, where 0
means empty and 1
means not empty, and an integer n
, return if n
new flowers can be planted in the flowerbed
without violating the no-adjacent-flowers rule.
+Given an integer array flowerbed
containing 0
's and 1
's, where 0
means empty and 1
means not empty, and an integer n
, return true
if n
new flowers can be planted in the flowerbed
without violating the no-adjacent-flowers rule and false
otherwise.
Example 1:
diff --git a/solution/0600-0699/0665.Non-decreasing Array/README_EN.md b/solution/0600-0699/0665.Non-decreasing Array/README_EN.md
index 28b39cb2b998f..cff20c9edeeff 100644
--- a/solution/0600-0699/0665.Non-decreasing Array/README_EN.md
+++ b/solution/0600-0699/0665.Non-decreasing Array/README_EN.md
@@ -77,7 +77,7 @@ class Solution {
}
return true;
}
-
+
private boolean isSorted(int[] nums) {
for (int i = 0; i < nums.length - 1; ++i) {
if (nums[i] > nums[i + 1]) {
diff --git a/solution/1400-1499/1406.Stone Game III/README_EN.md b/solution/1400-1499/1406.Stone Game III/README_EN.md
index 94789f20eefd9..1f921ea56b771 100644
--- a/solution/1400-1499/1406.Stone Game III/README_EN.md
+++ b/solution/1400-1499/1406.Stone Game III/README_EN.md
@@ -83,7 +83,7 @@ class Solution {
private int n;
private int[] s;
private Integer[] f;
-
+
public String stoneGameIII(int[] stoneValue) {
n = stoneValue.length;
s = new int[n + 1];
@@ -95,7 +95,7 @@ class Solution {
int b = s[n] - a;
return a == b ? "Tie" : a > b ? "Alice" : "Bob";
}
-
+
private int dfs(int i) {
if (i >= n) {
return 0;
diff --git a/solution/1600-1699/1630.Arithmetic Subarrays/README.md b/solution/1600-1699/1630.Arithmetic Subarrays/README.md
index 93c9d2b17b391..b88b9a31e52a3 100644
--- a/solution/1600-1699/1630.Arithmetic Subarrays/README.md
+++ b/solution/1600-1699/1630.Arithmetic Subarrays/README.md
@@ -63,9 +63,9 @@
函数 $check(nums, l, r)$ 的实现逻辑如下:
-- 首先,我们计算子数组的长度 $n = r - l + 1$,并将子数组中的元素放入集合 $s$ 中,方便后续的查找;
-- 然后,我们获取子数组中的最小值 $a_1$ 和最大值 $a_n$,如果 $a_n - a_1$ 不能被 $n - 1$ 整除,那么子数组不可能形成等差数列,直接返回 $false$;否则,我们计算等差数列的公差 $d = \frac{a_n - a_1}{n - 1}$;
-- 接下来从 $a_1$ 开始,依次计算等差数列中第 $i$ 项元素,如果第 $i$ 项元素 $a_1 + (i - 1) \times d$ 不在集合 $s$ 中,那么子数组不可能形成等差数列,直接返回 $false$;否则,当我们遍历完所有的元素,说明子数组可以重新排列形成等差数列,返回 $true$。
+- 首先,我们计算子数组的长度 $n = r - l + 1$,并将子数组中的元素放入集合 $s$ 中,方便后续的查找;
+- 然后,我们获取子数组中的最小值 $a_1$ 和最大值 $a_n$,如果 $a_n - a_1$ 不能被 $n - 1$ 整除,那么子数组不可能形成等差数列,直接返回 $false$;否则,我们计算等差数列的公差 $d = \frac{a_n - a_1}{n - 1}$;
+- 接下来从 $a_1$ 开始,依次计算等差数列中第 $i$ 项元素,如果第 $i$ 项元素 $a_1 + (i - 1) \times d$ 不在集合 $s$ 中,那么子数组不可能形成等差数列,直接返回 $false$;否则,当我们遍历完所有的元素,说明子数组可以重新排列形成等差数列,返回 $true$。
在主函数中,我们遍历所有的查询,对于每个查询 $l[i]$ 和 $r[i]$,我们调用函数 $check(nums, l[i], r[i])$ 判断子数组是否可以重新排列形成等差数列,将结果存入答案数组中。
@@ -86,7 +86,7 @@ class Solution:
a1, an = min(nums[l: l + n]), max(nums[l: l + n])
d, mod = divmod(an - a1, n - 1)
return mod == 0 and all((a1 + (i - 1) * d) in s for i in range(1, n))
-
+
return [check(nums, left, right) for left, right in zip(l, r)]
```
diff --git a/solution/1600-1699/1630.Arithmetic Subarrays/README_EN.md b/solution/1600-1699/1630.Arithmetic Subarrays/README_EN.md
index a741ff4b4e8a3..fb4e6e575b961 100644
--- a/solution/1600-1699/1630.Arithmetic Subarrays/README_EN.md
+++ b/solution/1600-1699/1630.Arithmetic Subarrays/README_EN.md
@@ -68,7 +68,7 @@ class Solution:
a1, an = min(nums[l: l + n]), max(nums[l: l + n])
d, mod = divmod(an - a1, n - 1)
return mod == 0 and all((a1 + (i - 1) * d) in s for i in range(1, n))
-
+
return [check(nums, left, right) for left, right in zip(l, r)]
```
diff --git a/solution/1600-1699/1638.Count Substrings That Differ by One Character/README.md b/solution/1600-1699/1638.Count Substrings That Differ by One Character/README.md
index 8e601085ec693..c226231892fd9 100644
--- a/solution/1600-1699/1638.Count Substrings That Differ by One Character/README.md
+++ b/solution/1600-1699/1638.Count Substrings That Differ by One Character/README.md
@@ -6,15 +6,15 @@
-给你两个字符串 s
和 t
,请你找出 s
中的非空子串的数目,这些子串满足替换 一个不同字符 以后,是 t
串的子串。换言之,请你找到 s
和 t
串中 恰好 只有一个字符不同的子字符串对的数目。
+给你两个字符串 s
和 t
,请你找出 s
中的非空子串的数目,这些子串满足替换 一个不同字符 以后,是 t
串的子串。换言之,请你找到 s
和 t
串中 恰好 只有一个字符不同的子字符串对的数目。
-比方说, "computer"
和 "computation"
加粗部分只有一个字符不同: 'e'
/'a'
,所以这一对子字符串会给答案加 1 。
+比方说, "computer"
and "computation"
只有一个字符不同: 'e'
/'a'
,所以这一对子字符串会给答案加 1 。
请你返回满足上述条件的不同子字符串对数目。
-一个 子字符串 是一个字符串中连续的字符。
+一个 子字符串 是一个字符串中连续的字符。
-
+
示例 1:
@@ -57,13 +57,13 @@
输出:10
-
+
提示:
- 1 <= s.length, t.length <= 100
- s
和 t
都只包含小写英文字母。
+ 1 <= s.length, t.length <= 100
+ s
和 t
都只包含小写英文字母。
## 解法
diff --git a/solution/1700-1799/1760.Minimum Limit of Balls in a Bag/README_EN.md b/solution/1700-1799/1760.Minimum Limit of Balls in a Bag/README_EN.md
index a9ff29d3ee201..c1482b7c67db1 100644
--- a/solution/1700-1799/1760.Minimum Limit of Balls in a Bag/README_EN.md
+++ b/solution/1700-1799/1760.Minimum Limit of Balls in a Bag/README_EN.md
@@ -10,10 +10,12 @@
- Take any bag of balls and divide it into two new bags with a positive number of balls.
+
- For example, a bag of
5
balls can become two new bags of 1
and 4
balls, or two new bags of 2
and 3
balls.
+
Your penalty is the maximum number of balls in a bag. You want to minimize your penalty after the operations.
diff --git a/solution/1900-1999/1943.Describe the Painting/README.md b/solution/1900-1999/1943.Describe the Painting/README.md
index 8684e3b9331ba..25ae959d87698 100644
--- a/solution/1900-1999/1943.Describe the Painting/README.md
+++ b/solution/1900-1999/1943.Describe the Painting/README.md
@@ -36,17 +36,19 @@
示例 1:
-
-输入:segments = [[1,4,5],[4,7,7],[1,7,9]]
+
+
+输入:segments = [[1,4,5],[4,7,7],[1,7,9]]
输出:[[1,4,14],[4,7,16]]
-解释:绘画借故偶可以表示为:
+解释:绘画结果可以表示为:
- [1,4) 颜色为 {5,9} (和为 14),分别来自第一和第二个线段。
- [4,7) 颜色为 {7,9} (和为 16),分别来自第二和第三个线段。
示例 2:
-
-输入:segments = [[1,7,9],[6,8,15],[8,10,7]]
+
+
+输入:segments = [[1,7,9],[6,8,15],[8,10,7]]
输出:[[1,6,9],[6,7,24],[7,8,15],[8,10,7]]
解释:绘画结果可以以表示为:
- [1,6) 颜色为 9 ,来自第一个线段。
@@ -56,8 +58,9 @@
示例 3:
-
-输入:segments = [[1,4,5],[1,4,7],[4,7,1],[4,7,11]]
+
+
+输入:segments = [[1,4,5],[1,4,7],[4,7,1],[4,7,11]]
输出:[[1,4,12],[4,7,12]]
解释:绘画结果可以表示为:
- [1,4) 颜色为 {5,7} (和为 12),分别来自第一和第二个线段。
diff --git a/solution/2200-2299/2251.Number of Flowers in Full Bloom/README_EN.md b/solution/2200-2299/2251.Number of Flowers in Full Bloom/README_EN.md
index 55bc3dad03783..13c9e63f4a373 100644
--- a/solution/2200-2299/2251.Number of Flowers in Full Bloom/README_EN.md
+++ b/solution/2200-2299/2251.Number of Flowers in Full Bloom/README_EN.md
@@ -4,7 +4,7 @@
## Description
-You are given a 0-indexed 2D integer array flowers
, where flowers[i] = [starti, endi]
means the ith
flower will be in full bloom from starti
to endi
(inclusive). You are also given a 0-indexed integer array persons
of size n
, where persons[i]
is the time that the ith
person will arrive to see the flowers.
+You are given a 0-indexed 2D integer array flowers
, where flowers[i] = [starti, endi]
means the ith
flower will be in full bloom from starti
to endi
(inclusive). You are also given a 0-indexed integer array people
of size n
, where poeple[i]
is the time that the ith
person will arrive to see the flowers.
Return an integer array answer
of size n
, where answer[i]
is the number of flowers that are in full bloom when the ith
person arrives.
@@ -12,7 +12,7 @@
Example 1:
-Input: flowers = [[1,6],[3,7],[9,12],[4,13]], persons = [2,3,7,11]
+Input: flowers = [[1,6],[3,7],[9,12],[4,13]], poeple = [2,3,7,11]
Output: [1,2,2,2]
Explanation: The figure above shows the times when the flowers are in full bloom and when the people arrive.
For each person, we return the number of flowers in full bloom during their arrival.
@@ -21,7 +21,7 @@ For each person, we return the number of flowers in full bloom during their arri
Example 2:
-Input: flowers = [[1,10],[3,3]], persons = [3,3,2]
+Input: flowers = [[1,10],[3,3]], poeple = [3,3,2]
Output: [2,2,1]
Explanation: The figure above shows the times when the flowers are in full bloom and when the people arrive.
For each person, we return the number of flowers in full bloom during their arrival.
@@ -34,8 +34,8 @@ For each person, we return the number of flowers in full bloom during their arri
1 <= flowers.length <= 5 * 104
flowers[i].length == 2
1 <= starti <= endi <= 109
- 1 <= persons.length <= 5 * 104
- 1 <= persons[i] <= 109
+ 1 <= people.length <= 5 * 104
+ 1 <= people[i] <= 109
## Solutions
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/README.md b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/README.md
new file mode 100644
index 0000000000000..5f8b656d4d1a2
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/README.md
@@ -0,0 +1,187 @@
+# [2599. Make the Prefix Sum Non-negative](https://leetcode.cn/problems/make-the-prefix-sum-non-negative)
+
+[English Version](/solution/2500-2599/2599.Make%20the%20Prefix%20Sum%20Non-negative/README_EN.md)
+
+## 题目描述
+
+
+
+You are given a 0-indexed integer array nums
. You can apply the following operation any number of times:
+
+
+ - Pick any element from
nums
and put it at the end of nums
.
+
+
+The prefix sum array of nums
is an array prefix
of the same length as nums
such that prefix[i]
is the sum of all the integers nums[j]
where j
is in the inclusive range [0, i]
.
+
+Return the minimum number of operations such that the prefix sum array does not contain negative integers. The test cases are generated such that it is always possible to make the prefix sum array non-negative.
+
+
+Example 1:
+
+
+Input: nums = [2,3,-5,4]
+Output: 0
+Explanation: we do not need to do any operations.
+The array is [2,3,-5,4]. The prefix sum array is [2, 5, 0, 4].
+
+
+Example 2:
+
+
+Input: nums = [3,-5,-2,6]
+Output: 1
+Explanation: we can do one operation on index 1.
+The array after the operation is [3,-2,6,-5]. The prefix sum array is [3, 1, 7, 2].
+
+
+
+Constraints:
+
+
+ 1 <= nums.length <= 105
+ -109 <= nums[i] <= 109
+
+
+## 解法
+
+
+
+**方法一:贪心 + 优先队列(小根堆)**
+
+我们用变量 $s$ 记录当前数组的前缀和。
+
+遍历数组 $nums$,将当前元素 $x$ 加入前缀和 $s$ 中,如果 $x$ 为负数,则将 $x$ 加入小根堆中。如果此时 $s$ 为负数,我们贪心地取出最小的负数,将其从 $s$ 中减去,同时将答案加一。最终返回答案即可。
+
+时间复杂度 $O(n \times \log n)$,空间复杂度 $O(n)$。其中 $n$ 为数组 $nums$ 的长度。
+
+
+
+### **Python3**
+
+
+
+```python
+class Solution:
+ def makePrefSumNonNegative(self, nums: List[int]) -> int:
+ h = []
+ ans = s = 0
+ for x in nums:
+ s += x
+ if x < 0:
+ heappush(h, x)
+ while s < 0:
+ s -= heappop(h)
+ ans += 1
+ return ans
+```
+
+### **Java**
+
+
+
+```java
+class Solution {
+ public int makePrefSumNonNegative(int[] nums) {
+ PriorityQueue pq = new PriorityQueue<>();
+ int ans = 0;
+ long s = 0;
+ for (int x : nums) {
+ s += x;
+ if (x < 0) {
+ pq.offer(x);
+ }
+ while (s < 0) {
+ s -= pq.poll();
+ ++ans;
+ }
+ }
+ return ans;
+ }
+}
+```
+
+### **C++**
+
+```cpp
+class Solution {
+public:
+ int makePrefSumNonNegative(vector& nums) {
+ priority_queue, greater> pq;
+ int ans = 0;
+ long long s = 0;
+ for (int& x : nums) {
+ s += x;
+ if (x < 0) {
+ pq.push(x);
+ }
+ while (s < 0) {
+ s -= pq.top();
+ pq.pop();
+ ++ans;
+ }
+ }
+ return ans;
+ }
+};
+```
+
+### **Go**
+
+```go
+func makePrefSumNonNegative(nums []int) (ans int) {
+ pq := hp{}
+ s := 0
+ for _, x := range nums {
+ s += x
+ if x < 0 {
+ heap.Push(&pq, x)
+ }
+ for s < 0 {
+ s -= heap.Pop(&pq).(int)
+ ans++
+ }
+ }
+ return ans
+}
+
+type hp struct{ sort.IntSlice }
+
+func (h hp) Less(i, j int) bool { return h.IntSlice[i] < h.IntSlice[j] }
+func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int)) }
+func (h *hp) Pop() interface{} {
+ a := h.IntSlice
+ v := a[len(a)-1]
+ h.IntSlice = a[:len(a)-1]
+ return v
+}
+```
+
+### **TypeScript**
+
+```ts
+function makePrefSumNonNegative(nums: number[]): number {
+ const pq = new MinPriorityQueue();
+ let ans = 0;
+ let s = 0;
+ for (const x of nums) {
+ s += x;
+ if (x < 0) {
+ pq.enqueue(x);
+ }
+ while (s < 0) {
+ s -= pq.dequeue().element;
+ ++ans;
+ }
+ }
+ return ans;
+}
+```
+
+### **...**
+
+```
+
+```
+
+
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/README_EN.md b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/README_EN.md
new file mode 100644
index 0000000000000..3992bba412709
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/README_EN.md
@@ -0,0 +1,171 @@
+# [2599. Make the Prefix Sum Non-negative](https://leetcode.com/problems/make-the-prefix-sum-non-negative)
+
+[中文文档](/solution/2500-2599/2599.Make%20the%20Prefix%20Sum%20Non-negative/README.md)
+
+## Description
+
+You are given a 0-indexed integer array nums
. You can apply the following operation any number of times:
+
+
+ - Pick any element from
nums
and put it at the end of nums
.
+
+
+The prefix sum array of nums
is an array prefix
of the same length as nums
such that prefix[i]
is the sum of all the integers nums[j]
where j
is in the inclusive range [0, i]
.
+
+Return the minimum number of operations such that the prefix sum array does not contain negative integers. The test cases are generated such that it is always possible to make the prefix sum array non-negative.
+
+
+Example 1:
+
+
+Input: nums = [2,3,-5,4]
+Output: 0
+Explanation: we do not need to do any operations.
+The array is [2,3,-5,4]. The prefix sum array is [2, 5, 0, 4].
+
+
+Example 2:
+
+
+Input: nums = [3,-5,-2,6]
+Output: 1
+Explanation: we can do one operation on index 1.
+The array after the operation is [3,-2,6,-5]. The prefix sum array is [3, 1, 7, 2].
+
+
+
+Constraints:
+
+
+ 1 <= nums.length <= 105
+ -109 <= nums[i] <= 109
+
+
+## Solutions
+
+
+
+### **Python3**
+
+```python
+class Solution:
+ def makePrefSumNonNegative(self, nums: List[int]) -> int:
+ h = []
+ ans = s = 0
+ for x in nums:
+ s += x
+ if x < 0:
+ heappush(h, x)
+ while s < 0:
+ s -= heappop(h)
+ ans += 1
+ return ans
+```
+
+### **Java**
+
+```java
+class Solution {
+ public int makePrefSumNonNegative(int[] nums) {
+ PriorityQueue pq = new PriorityQueue<>();
+ int ans = 0;
+ long s = 0;
+ for (int x : nums) {
+ s += x;
+ if (x < 0) {
+ pq.offer(x);
+ }
+ while (s < 0) {
+ s -= pq.poll();
+ ++ans;
+ }
+ }
+ return ans;
+ }
+}
+```
+
+### **C++**
+
+```cpp
+class Solution {
+public:
+ int makePrefSumNonNegative(vector& nums) {
+ priority_queue, greater> pq;
+ int ans = 0;
+ long long s = 0;
+ for (int& x : nums) {
+ s += x;
+ if (x < 0) {
+ pq.push(x);
+ }
+ while (s < 0) {
+ s -= pq.top();
+ pq.pop();
+ ++ans;
+ }
+ }
+ return ans;
+ }
+};
+```
+
+### **Go**
+
+```go
+func makePrefSumNonNegative(nums []int) (ans int) {
+ pq := hp{}
+ s := 0
+ for _, x := range nums {
+ s += x
+ if x < 0 {
+ heap.Push(&pq, x)
+ }
+ for s < 0 {
+ s -= heap.Pop(&pq).(int)
+ ans++
+ }
+ }
+ return ans
+}
+
+type hp struct{ sort.IntSlice }
+
+func (h hp) Less(i, j int) bool { return h.IntSlice[i] < h.IntSlice[j] }
+func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int)) }
+func (h *hp) Pop() interface{} {
+ a := h.IntSlice
+ v := a[len(a)-1]
+ h.IntSlice = a[:len(a)-1]
+ return v
+}
+```
+
+### **TypeScript**
+
+```ts
+function makePrefSumNonNegative(nums: number[]): number {
+ const pq = new MinPriorityQueue();
+ let ans = 0;
+ let s = 0;
+ for (const x of nums) {
+ s += x;
+ if (x < 0) {
+ pq.enqueue(x);
+ }
+ while (s < 0) {
+ s -= pq.dequeue().element;
+ ++ans;
+ }
+ }
+ return ans;
+}
+```
+
+### **...**
+
+```
+
+```
+
+
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.cpp b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.cpp
new file mode 100644
index 0000000000000..b27db89ff165a
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.cpp
@@ -0,0 +1,20 @@
+class Solution {
+public:
+ int makePrefSumNonNegative(vector& nums) {
+ priority_queue, greater> pq;
+ int ans = 0;
+ long long s = 0;
+ for (int& x : nums) {
+ s += x;
+ if (x < 0) {
+ pq.push(x);
+ }
+ while (s < 0) {
+ s -= pq.top();
+ pq.pop();
+ ++ans;
+ }
+ }
+ return ans;
+ }
+};
\ No newline at end of file
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.go b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.go
new file mode 100644
index 0000000000000..230c5a0abc1b6
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.go
@@ -0,0 +1,26 @@
+func makePrefSumNonNegative(nums []int) (ans int) {
+ pq := hp{}
+ s := 0
+ for _, x := range nums {
+ s += x
+ if x < 0 {
+ heap.Push(&pq, x)
+ }
+ for s < 0 {
+ s -= heap.Pop(&pq).(int)
+ ans++
+ }
+ }
+ return ans
+}
+
+type hp struct{ sort.IntSlice }
+
+func (h hp) Less(i, j int) bool { return h.IntSlice[i] < h.IntSlice[j] }
+func (h *hp) Push(v interface{}) { h.IntSlice = append(h.IntSlice, v.(int)) }
+func (h *hp) Pop() interface{} {
+ a := h.IntSlice
+ v := a[len(a)-1]
+ h.IntSlice = a[:len(a)-1]
+ return v
+}
\ No newline at end of file
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.java b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.java
new file mode 100644
index 0000000000000..af23ee619e462
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.java
@@ -0,0 +1,18 @@
+class Solution {
+ public int makePrefSumNonNegative(int[] nums) {
+ PriorityQueue pq = new PriorityQueue<>();
+ int ans = 0;
+ long s = 0;
+ for (int x : nums) {
+ s += x;
+ if (x < 0) {
+ pq.offer(x);
+ }
+ while (s < 0) {
+ s -= pq.poll();
+ ++ans;
+ }
+ }
+ return ans;
+ }
+}
\ No newline at end of file
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.py b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.py
new file mode 100644
index 0000000000000..a5b3482a234cc
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.py
@@ -0,0 +1,12 @@
+class Solution:
+ def makePrefSumNonNegative(self, nums: List[int]) -> int:
+ h = []
+ ans = s = 0
+ for x in nums:
+ s += x
+ if x < 0:
+ heappush(h, x)
+ while s < 0:
+ s -= heappop(h)
+ ans += 1
+ return ans
diff --git a/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.ts b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.ts
new file mode 100644
index 0000000000000..9f339be7f1849
--- /dev/null
+++ b/solution/2500-2599/2599.Make the Prefix Sum Non-negative/Solution.ts
@@ -0,0 +1,16 @@
+function makePrefSumNonNegative(nums: number[]): number {
+ const pq = new MinPriorityQueue();
+ let ans = 0;
+ let s = 0;
+ for (const x of nums) {
+ s += x;
+ if (x < 0) {
+ pq.enqueue(x);
+ }
+ while (s < 0) {
+ s -= pq.dequeue().element;
+ ++ans;
+ }
+ }
+ return ans;
+}
diff --git a/solution/README.md b/solution/README.md
index 00720e83b7e9e..e83bf44ebc4fd 100644
--- a/solution/README.md
+++ b/solution/README.md
@@ -33,7 +33,7 @@
| 0020 | [有效的括号](/solution/0000-0099/0020.Valid%20Parentheses/README.md) | `栈`,`字符串` | 简单 | |
| 0021 | [合并两个有序链表](/solution/0000-0099/0021.Merge%20Two%20Sorted%20Lists/README.md) | `递归`,`链表` | 简单 | |
| 0022 | [括号生成](/solution/0000-0099/0022.Generate%20Parentheses/README.md) | `字符串`,`动态规划`,`回溯` | 中等 | |
-| 0023 | [合并K个升序链表](/solution/0000-0099/0023.Merge%20k%20Sorted%20Lists/README.md) | `链表`,`分治`,`堆(优先队列)`,`归并排序` | 困难 | |
+| 0023 | [合并 K 个升序链表](/solution/0000-0099/0023.Merge%20k%20Sorted%20Lists/README.md) | `链表`,`分治`,`堆(优先队列)`,`归并排序` | 困难 | |
| 0024 | [两两交换链表中的节点](/solution/0000-0099/0024.Swap%20Nodes%20in%20Pairs/README.md) | `递归`,`链表` | 中等 | |
| 0025 | [K 个一组翻转链表](/solution/0000-0099/0025.Reverse%20Nodes%20in%20k-Group/README.md) | `递归`,`链表` | 困难 | |
| 0026 | [删除有序数组中的重复项](/solution/0000-0099/0026.Remove%20Duplicates%20from%20Sorted%20Array/README.md) | `数组`,`双指针` | 简单 | |
@@ -974,7 +974,7 @@
| 0961 | [在长度 2N 的数组中找出重复 N 次的元素](/solution/0900-0999/0961.N-Repeated%20Element%20in%20Size%202N%20Array/README.md) | `数组`,`哈希表` | 简单 | 第 116 场周赛 |
| 0962 | [最大宽度坡](/solution/0900-0999/0962.Maximum%20Width%20Ramp/README.md) | `栈`,`数组`,`单调栈` | 中等 | 第 116 场周赛 |
| 0963 | [最小面积矩形 II](/solution/0900-0999/0963.Minimum%20Area%20Rectangle%20II/README.md) | `几何`,`数组`,`数学` | 中等 | 第 116 场周赛 |
-| 0964 | [表示数字的最少运算符](/solution/0900-0999/0964.Least%20Operators%20to%20Express%20Number/README.md) | `数学`,`动态规划` | 困难 | 第 116 场周赛 |
+| 0964 | [表示数字的最少运算符](/solution/0900-0999/0964.Least%20Operators%20to%20Express%20Number/README.md) | `记忆化搜索`,`数学`,`动态规划` | 困难 | 第 116 场周赛 |
| 0965 | [单值二叉树](/solution/0900-0999/0965.Univalued%20Binary%20Tree/README.md) | `树`,`深度优先搜索`,`广度优先搜索`,`二叉树` | 简单 | 第 117 场周赛 |
| 0966 | [元音拼写检查器](/solution/0900-0999/0966.Vowel%20Spellchecker/README.md) | `数组`,`哈希表`,`字符串` | 中等 | 第 117 场周赛 |
| 0967 | [连续差相同的数字](/solution/0900-0999/0967.Numbers%20With%20Same%20Consecutive%20Differences/README.md) | `广度优先搜索`,`回溯` | 中等 | 第 117 场周赛 |
@@ -1697,7 +1697,7 @@
| 1684 | [统计一致字符串的数目](/solution/1600-1699/1684.Count%20the%20Number%20of%20Consistent%20Strings/README.md) | `位运算`,`数组`,`哈希表`,`字符串` | 简单 | 第 41 场双周赛 |
| 1685 | [有序数组中差绝对值之和](/solution/1600-1699/1685.Sum%20of%20Absolute%20Differences%20in%20a%20Sorted%20Array/README.md) | `数组`,`数学`,`前缀和` | 中等 | 第 41 场双周赛 |
| 1686 | [石子游戏 VI](/solution/1600-1699/1686.Stone%20Game%20VI/README.md) | `贪心`,`数组`,`数学`,`博弈`,`排序`,`堆(优先队列)` | 中等 | 第 41 场双周赛 |
-| 1687 | [从仓库到码头运输箱子](/solution/1600-1699/1687.Delivering%20Boxes%20from%20Storage%20to%20Ports/README.md) | `线段树`,`队列`,`数组`,`动态规划`,`单调队列`,`堆(优先队列)` | 困难 | 第 41 场双周赛 |
+| 1687 | [从仓库到码头运输箱子](/solution/1600-1699/1687.Delivering%20Boxes%20from%20Storage%20to%20Ports/README.md) | `线段树`,`队列`,`数组`,`动态规划`,`前缀和`,`单调队列`,`堆(优先队列)` | 困难 | 第 41 场双周赛 |
| 1688 | [比赛中的配对次数](/solution/1600-1699/1688.Count%20of%20Matches%20in%20Tournament/README.md) | `数学`,`模拟` | 简单 | 第 219 场周赛 |
| 1689 | [十-二进制数的最少数目](/solution/1600-1699/1689.Partitioning%20Into%20Minimum%20Number%20Of%20Deci-Binary%20Numbers/README.md) | `贪心`,`字符串` | 中等 | 第 219 场周赛 |
| 1690 | [石子游戏 VII](/solution/1600-1699/1690.Stone%20Game%20VII/README.md) | `数组`,`数学`,`动态规划`,`博弈` | 中等 | 第 219 场周赛 |
@@ -2582,7 +2582,7 @@
| 2569 | [更新数组后处理求和查询](/solution/2500-2599/2569.Handling%20Sum%20Queries%20After%20Update/README.md) | `线段树`,`数组` | 困难 | 第 98 场双周赛 |
| 2570 | [合并两个二维数组 - 求和法](/solution/2500-2599/2570.Merge%20Two%202D%20Arrays%20by%20Summing%20Values/README.md) | `数组`,`哈希表`,`双指针` | 简单 | 第 333 场周赛 |
| 2571 | [将整数减少到零需要的最少操作数](/solution/2500-2599/2571.Minimum%20Operations%20to%20Reduce%20an%20Integer%20to%200/README.md) | `贪心`,`位运算`,`动态规划` | 中等 | 第 333 场周赛 |
-| 2572 | [无平方子集计数](/solution/2500-2599/2572.Count%20the%20Number%20of%20Square-Free%20Subsets/README.md) | `数组`,`数学`,`动态规划`,`状态压缩` | 中等 | 第 333 场周赛 |
+| 2572 | [无平方子集计数](/solution/2500-2599/2572.Count%20the%20Number%20of%20Square-Free%20Subsets/README.md) | `位运算`,`数组`,`数学`,`动态规划`,`状态压缩` | 中等 | 第 333 场周赛 |
| 2573 | [找出对应 LCP 矩阵的字符串](/solution/2500-2599/2573.Find%20the%20String%20with%20LCP/README.md) | `贪心`,`并查集`,`字符串`,`动态规划` | 困难 | 第 333 场周赛 |
| 2574 | [左右元素和的差值](/solution/2500-2599/2574.Left%20and%20Right%20Sum%20Differences/README.md) | `数组`,`前缀和` | 简单 | 第 334 场周赛 |
| 2575 | [找出字符串的可整除数组](/solution/2500-2599/2575.Find%20the%20Divisibility%20Array%20of%20a%20String/README.md) | `数组`,`数学`,`字符串` | 中等 | 第 334 场周赛 |
@@ -2600,15 +2600,16 @@
| 2587 | [重排数组以得到最大前缀分数](/solution/2500-2599/2587.Rearrange%20Array%20to%20Maximize%20Prefix%20Score/README.md) | `贪心`,`数组`,`前缀和`,`排序` | 中等 | 第 336 场周赛 |
| 2588 | [统计美丽子数组数目](/solution/2500-2599/2588.Count%20the%20Number%20of%20Beautiful%20Subarrays/README.md) | `位运算`,`数组`,`哈希表`,`前缀和` | 中等 | 第 336 场周赛 |
| 2589 | [完成所有任务的最少时间](/solution/2500-2599/2589.Minimum%20Time%20to%20Complete%20All%20Tasks/README.md) | `栈`,`贪心`,`数组`,`二分查找`,`排序` | 困难 | 第 336 场周赛 |
-| 2590 | [Design a Todo List](/solution/2500-2599/2590.Design%20a%20Todo%20List/README.md) | | 中等 | 🔒 |
-| 2591 | [将钱分给最多的儿童](/solution/2500-2599/2591.Distribute%20Money%20to%20Maximum%20Children/README.md) | | 简单 | 第 100 场双周赛 |
-| 2592 | [最大化数组的伟大值](/solution/2500-2599/2592.Maximize%20Greatness%20of%20an%20Array/README.md) | | 中等 | 第 100 场双周赛 |
-| 2593 | [标记所有元素后数组的分数](/solution/2500-2599/2593.Find%20Score%20of%20an%20Array%20After%20Marking%20All%20Elements/README.md) | | 中等 | 第 100 场双周赛 |
-| 2594 | [修车的最少时间](/solution/2500-2599/2594.Minimum%20Time%20to%20Repair%20Cars/README.md) | | 中等 | 第 100 场双周赛 |
-| 2595 | [奇偶位数](/solution/2500-2599/2595.Number%20of%20Even%20and%20Odd%20Bits/README.md) | | 简单 | 第 337 场周赛 |
-| 2596 | [检查骑士巡视方案](/solution/2500-2599/2596.Check%20Knight%20Tour%20Configuration/README.md) | | 中等 | 第 337 场周赛 |
-| 2597 | [美丽子集的数目](/solution/2500-2599/2597.The%20Number%20of%20Beautiful%20Subsets/README.md) | | 中等 | 第 337 场周赛 |
-| 2598 | [执行操作后的最大 MEX](/solution/2500-2599/2598.Smallest%20Missing%20Non-negative%20Integer%20After%20Operations/README.md) | | 中等 | 第 337 场周赛 |
+| 2590 | [Design a Todo List](/solution/2500-2599/2590.Design%20a%20Todo%20List/README.md) | `设计`,`数组`,`哈希表`,`字符串`,`排序` | 中等 | 🔒 |
+| 2591 | [将钱分给最多的儿童](/solution/2500-2599/2591.Distribute%20Money%20to%20Maximum%20Children/README.md) | `贪心`,`数学` | 简单 | 第 100 场双周赛 |
+| 2592 | [最大化数组的伟大值](/solution/2500-2599/2592.Maximize%20Greatness%20of%20an%20Array/README.md) | `贪心`,`数组`,`双指针`,`排序` | 中等 | 第 100 场双周赛 |
+| 2593 | [标记所有元素后数组的分数](/solution/2500-2599/2593.Find%20Score%20of%20an%20Array%20After%20Marking%20All%20Elements/README.md) | `数组`,`排序`,`模拟`,`堆(优先队列)` | 中等 | 第 100 场双周赛 |
+| 2594 | [修车的最少时间](/solution/2500-2599/2594.Minimum%20Time%20to%20Repair%20Cars/README.md) | `数组`,`二分查找` | 中等 | 第 100 场双周赛 |
+| 2595 | [奇偶位数](/solution/2500-2599/2595.Number%20of%20Even%20and%20Odd%20Bits/README.md) | `位运算` | 简单 | 第 337 场周赛 |
+| 2596 | [检查骑士巡视方案](/solution/2500-2599/2596.Check%20Knight%20Tour%20Configuration/README.md) | `深度优先搜索`,`广度优先搜索`,`数组`,`矩阵`,`模拟` | 中等 | 第 337 场周赛 |
+| 2597 | [美丽子集的数目](/solution/2500-2599/2597.The%20Number%20of%20Beautiful%20Subsets/README.md) | `数组`,`动态规划`,`回溯` | 中等 | 第 337 场周赛 |
+| 2598 | [执行操作后的最大 MEX](/solution/2500-2599/2598.Smallest%20Missing%20Non-negative%20Integer%20After%20Operations/README.md) | `贪心`,`数组`,`哈希表`,`数学` | 中等 | 第 337 场周赛 |
+| 2599 | [Make the Prefix Sum Non-negative](/solution/2500-2599/2599.Make%20the%20Prefix%20Sum%20Non-negative/README.md) | | 中等 | 🔒 |
## 版权
diff --git a/solution/README_EN.md b/solution/README_EN.md
index 6dea2de360fb9..21ff9cbd9d99f 100644
--- a/solution/README_EN.md
+++ b/solution/README_EN.md
@@ -972,7 +972,7 @@ Press Control+F(or Command+F on the
| 0961 | [N-Repeated Element in Size 2N Array](/solution/0900-0999/0961.N-Repeated%20Element%20in%20Size%202N%20Array/README_EN.md) | `Array`,`Hash Table` | Easy | Weekly Contest 116 |
| 0962 | [Maximum Width Ramp](/solution/0900-0999/0962.Maximum%20Width%20Ramp/README_EN.md) | `Stack`,`Array`,`Monotonic Stack` | Medium | Weekly Contest 116 |
| 0963 | [Minimum Area Rectangle II](/solution/0900-0999/0963.Minimum%20Area%20Rectangle%20II/README_EN.md) | `Geometry`,`Array`,`Math` | Medium | Weekly Contest 116 |
-| 0964 | [Least Operators to Express Number](/solution/0900-0999/0964.Least%20Operators%20to%20Express%20Number/README_EN.md) | `Math`,`Dynamic Programming` | Hard | Weekly Contest 116 |
+| 0964 | [Least Operators to Express Number](/solution/0900-0999/0964.Least%20Operators%20to%20Express%20Number/README_EN.md) | `Memoization`,`Math`,`Dynamic Programming` | Hard | Weekly Contest 116 |
| 0965 | [Univalued Binary Tree](/solution/0900-0999/0965.Univalued%20Binary%20Tree/README_EN.md) | `Tree`,`Depth-First Search`,`Breadth-First Search`,`Binary Tree` | Easy | Weekly Contest 117 |
| 0966 | [Vowel Spellchecker](/solution/0900-0999/0966.Vowel%20Spellchecker/README_EN.md) | `Array`,`Hash Table`,`String` | Medium | Weekly Contest 117 |
| 0967 | [Numbers With Same Consecutive Differences](/solution/0900-0999/0967.Numbers%20With%20Same%20Consecutive%20Differences/README_EN.md) | `Breadth-First Search`,`Backtracking` | Medium | Weekly Contest 117 |
@@ -1695,7 +1695,7 @@ Press Control+F(or Command+F on the
| 1684 | [Count the Number of Consistent Strings](/solution/1600-1699/1684.Count%20the%20Number%20of%20Consistent%20Strings/README_EN.md) | `Bit Manipulation`,`Array`,`Hash Table`,`String` | Easy | Biweekly Contest 41 |
| 1685 | [Sum of Absolute Differences in a Sorted Array](/solution/1600-1699/1685.Sum%20of%20Absolute%20Differences%20in%20a%20Sorted%20Array/README_EN.md) | `Array`,`Math`,`Prefix Sum` | Medium | Biweekly Contest 41 |
| 1686 | [Stone Game VI](/solution/1600-1699/1686.Stone%20Game%20VI/README_EN.md) | `Greedy`,`Array`,`Math`,`Game Theory`,`Sorting`,`Heap (Priority Queue)` | Medium | Biweekly Contest 41 |
-| 1687 | [Delivering Boxes from Storage to Ports](/solution/1600-1699/1687.Delivering%20Boxes%20from%20Storage%20to%20Ports/README_EN.md) | `Segment Tree`,`Queue`,`Array`,`Dynamic Programming`,`Monotonic Queue`,`Heap (Priority Queue)` | Hard | Biweekly Contest 41 |
+| 1687 | [Delivering Boxes from Storage to Ports](/solution/1600-1699/1687.Delivering%20Boxes%20from%20Storage%20to%20Ports/README_EN.md) | `Segment Tree`,`Queue`,`Array`,`Dynamic Programming`,`Prefix Sum`,`Monotonic Queue`,`Heap (Priority Queue)` | Hard | Biweekly Contest 41 |
| 1688 | [Count of Matches in Tournament](/solution/1600-1699/1688.Count%20of%20Matches%20in%20Tournament/README_EN.md) | `Math`,`Simulation` | Easy | Weekly Contest 219 |
| 1689 | [Partitioning Into Minimum Number Of Deci-Binary Numbers](/solution/1600-1699/1689.Partitioning%20Into%20Minimum%20Number%20Of%20Deci-Binary%20Numbers/README_EN.md) | `Greedy`,`String` | Medium | Weekly Contest 219 |
| 1690 | [Stone Game VII](/solution/1600-1699/1690.Stone%20Game%20VII/README_EN.md) | `Array`,`Math`,`Dynamic Programming`,`Game Theory` | Medium | Weekly Contest 219 |
@@ -2580,7 +2580,7 @@ Press Control+F(or Command+F on the
| 2569 | [Handling Sum Queries After Update](/solution/2500-2599/2569.Handling%20Sum%20Queries%20After%20Update/README_EN.md) | `Segment Tree`,`Array` | Hard | Biweekly Contest 98 |
| 2570 | [Merge Two 2D Arrays by Summing Values](/solution/2500-2599/2570.Merge%20Two%202D%20Arrays%20by%20Summing%20Values/README_EN.md) | `Array`,`Hash Table`,`Two Pointers` | Easy | Weekly Contest 333 |
| 2571 | [Minimum Operations to Reduce an Integer to 0](/solution/2500-2599/2571.Minimum%20Operations%20to%20Reduce%20an%20Integer%20to%200/README_EN.md) | `Greedy`,`Bit Manipulation`,`Dynamic Programming` | Medium | Weekly Contest 333 |
-| 2572 | [Count the Number of Square-Free Subsets](/solution/2500-2599/2572.Count%20the%20Number%20of%20Square-Free%20Subsets/README_EN.md) | `Array`,`Math`,`Dynamic Programming`,`Bitmask` | Medium | Weekly Contest 333 |
+| 2572 | [Count the Number of Square-Free Subsets](/solution/2500-2599/2572.Count%20the%20Number%20of%20Square-Free%20Subsets/README_EN.md) | `Bit Manipulation`,`Array`,`Math`,`Dynamic Programming`,`Bitmask` | Medium | Weekly Contest 333 |
| 2573 | [Find the String with LCP](/solution/2500-2599/2573.Find%20the%20String%20with%20LCP/README_EN.md) | `Greedy`,`Union Find`,`String`,`Dynamic Programming` | Hard | Weekly Contest 333 |
| 2574 | [Left and Right Sum Differences](/solution/2500-2599/2574.Left%20and%20Right%20Sum%20Differences/README_EN.md) | `Array`,`Prefix Sum` | Easy | Weekly Contest 334 |
| 2575 | [Find the Divisibility Array of a String](/solution/2500-2599/2575.Find%20the%20Divisibility%20Array%20of%20a%20String/README_EN.md) | `Array`,`Math`,`String` | Medium | Weekly Contest 334 |
@@ -2598,15 +2598,16 @@ Press Control+F(or Command+F on the
| 2587 | [Rearrange Array to Maximize Prefix Score](/solution/2500-2599/2587.Rearrange%20Array%20to%20Maximize%20Prefix%20Score/README_EN.md) | `Greedy`,`Array`,`Prefix Sum`,`Sorting` | Medium | Weekly Contest 336 |
| 2588 | [Count the Number of Beautiful Subarrays](/solution/2500-2599/2588.Count%20the%20Number%20of%20Beautiful%20Subarrays/README_EN.md) | `Bit Manipulation`,`Array`,`Hash Table`,`Prefix Sum` | Medium | Weekly Contest 336 |
| 2589 | [Minimum Time to Complete All Tasks](/solution/2500-2599/2589.Minimum%20Time%20to%20Complete%20All%20Tasks/README_EN.md) | `Stack`,`Greedy`,`Array`,`Binary Search`,`Sorting` | Hard | Weekly Contest 336 |
-| 2590 | [Design a Todo List](/solution/2500-2599/2590.Design%20a%20Todo%20List/README_EN.md) | | Medium | 🔒 |
-| 2591 | [Distribute Money to Maximum Children](/solution/2500-2599/2591.Distribute%20Money%20to%20Maximum%20Children/README_EN.md) | | Easy | Biweekly Contest 100 |
-| 2592 | [Maximize Greatness of an Array](/solution/2500-2599/2592.Maximize%20Greatness%20of%20an%20Array/README_EN.md) | | Medium | Biweekly Contest 100 |
-| 2593 | [Find Score of an Array After Marking All Elements](/solution/2500-2599/2593.Find%20Score%20of%20an%20Array%20After%20Marking%20All%20Elements/README_EN.md) | | Medium | Biweekly Contest 100 |
-| 2594 | [Minimum Time to Repair Cars](/solution/2500-2599/2594.Minimum%20Time%20to%20Repair%20Cars/README_EN.md) | | Medium | Biweekly Contest 100 |
-| 2595 | [Number of Even and Odd Bits](/solution/2500-2599/2595.Number%20of%20Even%20and%20Odd%20Bits/README_EN.md) | | Easy | Weekly Contest 337 |
-| 2596 | [Check Knight Tour Configuration](/solution/2500-2599/2596.Check%20Knight%20Tour%20Configuration/README_EN.md) | | Medium | Weekly Contest 337 |
-| 2597 | [The Number of Beautiful Subsets](/solution/2500-2599/2597.The%20Number%20of%20Beautiful%20Subsets/README_EN.md) | | Medium | Weekly Contest 337 |
-| 2598 | [Smallest Missing Non-negative Integer After Operations](/solution/2500-2599/2598.Smallest%20Missing%20Non-negative%20Integer%20After%20Operations/README_EN.md) | | Medium | Weekly Contest 337 |
+| 2590 | [Design a Todo List](/solution/2500-2599/2590.Design%20a%20Todo%20List/README_EN.md) | `Design`,`Array`,`Hash Table`,`String`,`Sorting` | Medium | 🔒 |
+| 2591 | [Distribute Money to Maximum Children](/solution/2500-2599/2591.Distribute%20Money%20to%20Maximum%20Children/README_EN.md) | `Greedy`,`Math` | Easy | Biweekly Contest 100 |
+| 2592 | [Maximize Greatness of an Array](/solution/2500-2599/2592.Maximize%20Greatness%20of%20an%20Array/README_EN.md) | `Greedy`,`Array`,`Two Pointers`,`Sorting` | Medium | Biweekly Contest 100 |
+| 2593 | [Find Score of an Array After Marking All Elements](/solution/2500-2599/2593.Find%20Score%20of%20an%20Array%20After%20Marking%20All%20Elements/README_EN.md) | `Array`,`Sorting`,`Simulation`,`Heap (Priority Queue)` | Medium | Biweekly Contest 100 |
+| 2594 | [Minimum Time to Repair Cars](/solution/2500-2599/2594.Minimum%20Time%20to%20Repair%20Cars/README_EN.md) | `Array`,`Binary Search` | Medium | Biweekly Contest 100 |
+| 2595 | [Number of Even and Odd Bits](/solution/2500-2599/2595.Number%20of%20Even%20and%20Odd%20Bits/README_EN.md) | `Bit Manipulation` | Easy | Weekly Contest 337 |
+| 2596 | [Check Knight Tour Configuration](/solution/2500-2599/2596.Check%20Knight%20Tour%20Configuration/README_EN.md) | `Depth-First Search`,`Breadth-First Search`,`Array`,`Matrix`,`Simulation` | Medium | Weekly Contest 337 |
+| 2597 | [The Number of Beautiful Subsets](/solution/2500-2599/2597.The%20Number%20of%20Beautiful%20Subsets/README_EN.md) | `Array`,`Dynamic Programming`,`Backtracking` | Medium | Weekly Contest 337 |
+| 2598 | [Smallest Missing Non-negative Integer After Operations](/solution/2500-2599/2598.Smallest%20Missing%20Non-negative%20Integer%20After%20Operations/README_EN.md) | `Greedy`,`Array`,`Hash Table`,`Math` | Medium | Weekly Contest 337 |
+| 2599 | [Make the Prefix Sum Non-negative](/solution/2500-2599/2599.Make%20the%20Prefix%20Sum%20Non-negative/README_EN.md) | | Medium | 🔒 |
## Copyright
diff --git a/solution/summary.md b/solution/summary.md
index 9d5ba43a67ec6..6b169187ad6b3 100644
--- a/solution/summary.md
+++ b/solution/summary.md
@@ -22,7 +22,7 @@
- [0020.有效的括号](/solution/0000-0099/0020.Valid%20Parentheses/README.md)
- [0021.合并两个有序链表](/solution/0000-0099/0021.Merge%20Two%20Sorted%20Lists/README.md)
- [0022.括号生成](/solution/0000-0099/0022.Generate%20Parentheses/README.md)
- - [0023.合并K个升序链表](/solution/0000-0099/0023.Merge%20k%20Sorted%20Lists/README.md)
+ - [0023.合并 K 个升序链表](/solution/0000-0099/0023.Merge%20k%20Sorted%20Lists/README.md)
- [0024.两两交换链表中的节点](/solution/0000-0099/0024.Swap%20Nodes%20in%20Pairs/README.md)
- [0025.K 个一组翻转链表](/solution/0000-0099/0025.Reverse%20Nodes%20in%20k-Group/README.md)
- [0026.删除有序数组中的重复项](/solution/0000-0099/0026.Remove%20Duplicates%20from%20Sorted%20Array/README.md)
@@ -2648,3 +2648,4 @@
- [2596.检查骑士巡视方案](/solution/2500-2599/2596.Check%20Knight%20Tour%20Configuration/README.md)
- [2597.美丽子集的数目](/solution/2500-2599/2597.The%20Number%20of%20Beautiful%20Subsets/README.md)
- [2598.执行操作后的最大 MEX](/solution/2500-2599/2598.Smallest%20Missing%20Non-negative%20Integer%20After%20Operations/README.md)
+ - [2599.Make the Prefix Sum Non-negative](/solution/2500-2599/2599.Make%20the%20Prefix%20Sum%20Non-negative/README.md)
diff --git a/solution/summary_en.md b/solution/summary_en.md
index 0e0c7a6200e5b..08169a0e21468 100644
--- a/solution/summary_en.md
+++ b/solution/summary_en.md
@@ -2648,3 +2648,4 @@
- [2596.Check Knight Tour Configuration](/solution/2500-2599/2596.Check%20Knight%20Tour%20Configuration/README_EN.md)
- [2597.The Number of Beautiful Subsets](/solution/2500-2599/2597.The%20Number%20of%20Beautiful%20Subsets/README_EN.md)
- [2598.Smallest Missing Non-negative Integer After Operations](/solution/2500-2599/2598.Smallest%20Missing%20Non-negative%20Integer%20After%20Operations/README_EN.md)
+ - [2599.Make the Prefix Sum Non-negative](/solution/2500-2599/2599.Make%20the%20Prefix%20Sum%20Non-negative/README_EN.md)