Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 29a59f3

Browse files
aQuaaQua
aQua
authored and
aQua
committed
598 finish
1 parent ef18f66 commit 29a59f3

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

Algorithms/0598.range-addition-ii/README.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,40 @@
33
## 题目
44

55
Given an m * n matrix M initialized with all 0's and several update operations.
6-
Operations are represented by a 2D array, and each operation is represented by an array with two positive integers a and b, which means M[i][j] should be added by one for all 0 <= i < a and 0 <= j < b.
6+
Operations are represented by a 2D array, and each operation is represented by an array with two positive integers a and b, which means M[i][j] should be added by one for all 0 <= i < a and 0 <= j < b.
77
You need to count and return the number of maximum integers in the matrix after performing all the operations.
88

99
Example 1:
10-
Input:
10+
11+
```text
12+
Input:
1113
m = 3, n = 3
1214
operations = [[2,2],[3,3]]
1315
Output: 4
14-
Explanation:
15-
Initially, M =
16+
Explanation:
17+
Initially, M =
1618
[[0, 0, 0],
1719
[0, 0, 0],
1820
[0, 0, 0]]
1921
20-
After performing [2,2], M =
22+
After performing [2,2], M =
2123
[[1, 1, 0],
2224
[1, 1, 0],
2325
[0, 0, 0]]
2426
25-
After performing [3,3], M =
27+
After performing [3,3], M =
2628
[[2, 2, 1],
2729
[2, 2, 1],
2830
[1, 1, 1]]
2931
3032
So the maximum integer in M is 2, and there are four of it in M. So return 4.
31-
32-
33+
```
3334

3435
Note:
3536

36-
The range of m and n is [1,40000].
37-
The range of a is [1,m], and the range of b is [1,n].
38-
The range of operations size won't exceed 10,000.
37+
1. The range of m and n is [1,40000].
38+
1. The range of a is [1,m], and the range of b is [1,n].
39+
1. The range of operations size won't exceed 10,000.
3940

4041
## 解题思路
4142

0 commit comments

Comments
 (0)