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

Commitf3472c1

Browse files
refactor 1289
1 parent732440f commitf3472c1

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,5 @@
11
packagecom.fishercoder.solutions;
22

3-
/**
4-
* 1289. Minimum Falling Path Sum II
5-
*
6-
* Given a square grid of integers arr, a falling path with non-zero shifts is a
7-
* choice of exactly one element from each row of arr, such that no two elements chosen in adjacent rows are in the same column.
8-
* Return the minimum sum of a falling path with non-zero shifts.
9-
*
10-
* Example 1:
11-
* Input: arr = [[1,2,3],[4,5,6],[7,8,9]]
12-
* Output: 13
13-
* Explanation:
14-
* The possible falling paths are:
15-
* [1,5,9], [1,5,7], [1,6,7], [1,6,8],
16-
* [2,4,8], [2,4,9], [2,6,7], [2,6,8],
17-
* [3,4,8], [3,4,9], [3,5,7], [3,5,9]
18-
* The falling path with the smallest sum is [1,5,7], so the answer is 13.
19-
*
20-
* Constraints:
21-
* 1 <= arr.length == arr[i].length <= 200
22-
* -99 <= arr[i][j] <= 99
23-
* */
243
publicclass_1289 {
254
publicstaticclassSolution1 {
265
publicintminFallingPathSum(int[][]arr) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp