Skip to content

Commit b33dd9b

Browse files
committed
add 1091 java
1 parent e2054e2 commit b33dd9b

File tree

4 files changed

+65
-10
lines changed

4 files changed

+65
-10
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@
939939
967|[Numbers With Same Consecutive Differences](https://leetcode.com/problems/numbers-with-same-consecutive-differences/)| [Python](./leetcode_python/Breadth-First-Search/numbers-with-same-consecutive-differences.py) | _O(2^n)_ | _O(2^n)_ | Medium |`good trick` | AGAIN** (3)
940940
675|[Cut Off Trees for Golf Event](https://leetcode.com/problems/cut-off-trees-for-golf-event/)| [Python](./leetcode_python/Breadth-First-Search/cut-off-trees-for-golf-event.py), [Java](./leetcode_java/Breadth-First-Search/cut-off-trees-for-golf-event.java) ||| Hard |tree, BFS, complex, `amazon` | AGAIN (not start)
941941
864|[Shortest Path to Get All Keys](https://leetcode.com/problems/shortest-path-to-get-all-keys/)| [Python](./leetcode_python/Breadth-First-Search/shortest-path-to-get-all-keys.py) ||| Hard |BFS, `amazon` | AGAIN (not start)
942+
1091|[Shortest Path in Binary Matrix](https://leetcode.com/problems/shortest-path-in-binary-matrix/description/)| [Java](./leetcode_java/src/main/java/LeetCodeJava/BFS/ShortestPathInBinaryMatrix.java) ||| Medium |BFS, `google` | AGAIN (not start)
942943
994|[Rotting Oranges](https://leetcode.com/problems/rotting-oranges/)| [Python](./leetcode_python/Breadth-First-Search/rotting-oranges.py), [Java](./leetcode_java/src/main/java/LeetCodeJava/BFS/RottingOranges.java) ||| Medium |BFS, dp `amazon` | OK** (2)
943944
1110|[Delete Nodes And Return Forest](https://leetcode.com/problems/delete-nodes-and-return-forest/editorial/)| [Python](./leetcode_python/Breadth-First-Search/delete_nodes_and_return_forest.py), [Java](./leetcode_java/src/main/java/LeetCodeJava/BFS/DeleteNodesAndReturnForest.java) ||| Medium |BFS, recursive `google` | not start
944945
1162| [As Far from Land as Possible](https://leetcode.com/problems/as-far-from-land-as-possible/) | [Python](./leetcode_python/Breadth-First-Search/as-far-from-land-as-possible.py) | | | Medium | dfs, bfs, good basic, `amazon`| AGAIN**** (3)

data/progress.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
20250105: 399
1+
20250105: 399,1091
22
20250104: 1031,369
33
20250101: 729,731
44
20241231: 769,817,855(again)

data/to_review.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2025-03-01 -> ['399']
1+
2025-03-01 -> ['399,1091']
22
2025-02-28 -> ['1031,369']
33
2025-02-25 -> ['729,731']
44
2025-02-24 -> ['769,817,855(again)']
@@ -8,34 +8,34 @@
88
2025-02-15 -> ['369,311']
99
2025-02-14 -> ['370']
1010
2025-02-13 -> ['815,871,593,1109']
11-
2025-02-08 -> ['399']
11+
2025-02-08 -> ['399,1091']
1212
2025-02-07 -> ['1031,369', '560,523']
1313
2025-02-04 -> ['729,731']
1414
2025-02-03 -> ['769,817,855(again)']
1515
2025-02-01 -> ['498(again),934', '304,853,325']
1616
2025-01-31 -> ['379,173']
1717
2025-01-30 -> ['079,212(todo),362,849']
18-
2025-01-26 -> ['399', '370(todo)']
18+
2025-01-26 -> ['399,1091', '370(todo)']
1919
2025-01-25 -> ['1031,369', '369,311']
2020
2025-01-24 -> ['370', '34,767']
2121
2025-01-23 -> ['815,871,593,1109']
2222
2025-01-22 -> ['729,731']
2323
2025-01-21 -> ['769,817,855(again)']
2424
2025-01-20 -> ['722,380']
2525
2025-01-19 -> ['498(again),934', '33,81']
26-
2025-01-18 -> ['399', '379,173']
26+
2025-01-18 -> ['399,1091', '379,173']
2727
2025-01-17 -> ['1031,369', '079,212(todo),362,849', '560,523', '253']
2828
2025-01-16 -> ['776,31']
2929
2025-01-15 -> ['004(todo),34(todo),162(todo),275(todo)']
3030
2025-01-14 -> ['729,731', '986(todo),1229(todo),1868(todo),80(todo),209(todo),283(todo),360(todo),713(todo),532(todo),611(todo)']
31-
2025-01-13 -> ['399', '769,817,855(again)']
31+
2025-01-13 -> ['399,1091', '769,817,855(again)']
3232
2025-01-12 -> ['1031,369', '369,311']
3333
2025-01-11 -> ['498(again),934', '370', '304,853,325', '394']
34-
2025-01-10 -> ['399', '379,173', '815,871,593,1109', '833,950']
34+
2025-01-10 -> ['399,1091', '379,173', '815,871,593,1109', '833,950']
3535
2025-01-09 -> ['1031,369', '729,731', '079,212(todo),362,849']
36-
2025-01-08 -> ['399', '769,817,855(again)']
37-
2025-01-07 -> ['399', '1031,369']
38-
2025-01-06 -> ['399', '1031,369', '729,731', '498(again),934']
36+
2025-01-08 -> ['399,1091', '769,817,855(again)']
37+
2025-01-07 -> ['399,1091', '1031,369']
38+
2025-01-06 -> ['399,1091', '1031,369', '729,731', '498(again),934']
3939
2025-01-05 -> ['1031,369', '769,817,855(again)', '379,173', '370(todo)']
4040
2025-01-04 -> ['729,731', '079,212(todo),362,849', '369,311', '560,523', '53,210,207']
4141
2025-01-03 -> ['729,731', '769,817,855(again)', '498(again),934', '370', '34,767', '444']
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package LeetCodeJava.BFS;
2+
3+
// https://leetcode.com/problems/shortest-path-in-binary-matrix/description/
4+
/**
5+
* 1091. Shortest Path in Binary Matrix
6+
* Medium
7+
* Topics
8+
* Companies
9+
* Hint
10+
* Given an n x n binary matrix grid, return the length of the shortest clear path in the matrix. If there is no clear path, return -1.
11+
*
12+
* A clear path in a binary matrix is a path from the top-left cell (i.e., (0, 0)) to the bottom-right cell (i.e., (n - 1, n - 1)) such that:
13+
*
14+
* All the visited cells of the path are 0.
15+
* All the adjacent cells of the path are 8-directionally connected (i.e., they are different and they share an edge or a corner).
16+
* The length of a clear path is the number of visited cells of this path.
17+
*
18+
*
19+
*
20+
* Example 1:
21+
*
22+
*
23+
* Input: grid = [[0,1],[1,0]]
24+
* Output: 2
25+
* Example 2:
26+
*
27+
*
28+
* Input: grid = [[0,0,0],[1,1,0],[1,1,0]]
29+
* Output: 4
30+
* Example 3:
31+
*
32+
* Input: grid = [[1,0,0],[1,1,0],[1,1,0]]
33+
* Output: -1
34+
*
35+
*
36+
* Constraints:
37+
*
38+
* n == grid.length
39+
* n == grid[i].length
40+
* 1 <= n <= 100
41+
* grid[i][j] is 0 or 1
42+
*
43+
*/
44+
public class ShortestPathInBinaryMatrix {
45+
46+
// V0
47+
// public int shortestPathBinaryMatrix(int[][] grid) {
48+
//
49+
// }
50+
51+
// V1
52+
53+
// V2
54+
}

0 commit comments

Comments
 (0)