Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0fba81

Browse files
refactor 1314
1 parent94ba1eb commitb0fba81

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

‎src/main/java/com/fishercoder/solutions/_1314.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,6 @@
33
importjava.util.ArrayList;
44
importjava.util.List;
55

6-
/**
7-
* 1314. Matrix Block Sum
8-
*
9-
* Given a m * n matrix mat and an integer K,
10-
* return a matrix answer where each answer[i][j] is the sum of all elements
11-
* mat[r][c] for i - K <= r <= i + K, j - K <= c <= j + K, and (r, c) is a valid position in the matrix.
12-
*
13-
* Example 1:
14-
* Input: mat = [[1,2,3],[4,5,6],[7,8,9]], K = 1
15-
* Output: [[12,21,16],[27,45,33],[24,39,28]]
16-
*
17-
* Example 2:
18-
* Input: mat = [[1,2,3],[4,5,6],[7,8,9]], K = 2
19-
* Output: [[45,45,45],[45,45,45],[45,45,45]]
20-
*
21-
* Constraints:
22-
* m == mat.length
23-
* n == mat[i].length
24-
* 1 <= m, n, K <= 100
25-
* 1 <= mat[i][j] <= 100
26-
* */
276
publicclass_1314 {
287
publicstaticclassSolution1 {
298
publicint[][]matrixBlockSum(int[][]mat,intK) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp