File tree 1 file changed +0
-39
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 598. Range Addition II
5
-
6
- Given an m * n matrix m initialized with all 0's and several update operations.
7
- Operations are represented by a 2D array,
8
- and each operation is represented by an array with two positive integers a and b,
9
- which means m[i][j] should be added by one for all 0 <= i < a and 0 <= j < b.
10
-
11
- You need to count and return the number of maximum integers in the matrix after performing all the operations.
12
-
13
- Example 1:
14
- Input:
15
- m = 3, n = 3
16
- operations = [[2,2],[3,3]]
17
- Output: 4
18
-
19
- Explanation:
20
- Initially, m =
21
- [[0, 0, 0],
22
- [0, 0, 0],
23
- [0, 0, 0]]
24
-
25
- After performing [2,2], m =
26
- [[1, 1, 0],
27
- [1, 1, 0],
28
- [0, 0, 0]]
29
-
30
- After performing [3,3], m =
31
- [[2, 2, 1],
32
- [2, 2, 1],
33
- [1, 1, 1]]
34
-
35
- So the maximum integer in m is 2, and there are four of it in m. So return 4.
36
- Note:
37
- The range of m and n is [1,40000].
38
- The range of a is [1,m], and the range of b is [1,n].
39
- The range of operations size won't exceed 10,000.
40
- */
41
-
42
3
public class _598 {
43
4
44
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments