File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
main/java/com/fishercoder/solutions
test/java/com/fishercoder Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ Your ideas/fixes/algorithms are more than welcome!
104
104
| 493| [ Reverse Pairs] ( https://leetcode.com/problems/reverse-pairs/ ) | [ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_493.java ) | O(?) | O(?) | Hard|
105
105
|492|[ Construct the Rectangle] ( https://leetcode.com/problems/construct-the-rectangle/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/ConstructTheRectangle.java ) | O(n) |O(1) | Easy| Array
106
106
|491|[ Increasing Subsequences] ( https://leetcode.com/problems/increasing-subsequences/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_491.java ) | O(n!) |O(n) | Medium| Backtracking, DFS
107
- |490|[ The Maze] ( https://leetcode.com/problems/the-maze/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/TheMaze .java ) | O(m* n) |O(m* n) | Medium| BFS
107
+ |490|[ The Maze] ( https://leetcode.com/problems/the-maze/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_490 .java ) | O(m* n) |O(m* n) | Medium| BFS
108
108
|488|[ Zuma Game] ( https://leetcode.com/problems/zuma-game/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_488.java ) | O(?) |O(?) | Hard | DFS, Backtracking
109
109
|487|[ Max Consecutive Ones II] ( https://leetcode.com/problems/max-consecutive-ones-ii/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/MaxConsecutiveOnesII.java ) | O(n) |O(n) | Medium| Array
110
110
|486|[ Predict the Winner] ( https://leetcode.com/problems/predict-the-winner/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_486.java ) | O(2^n) |O(n^2) | Medium | DP
Original file line number Diff line number Diff line change 48
48
The given maze does not contain border (like the red rectangle in the example pictures), but you could assume the border of the maze are all walls.
49
49
The maze contains at least 2 empty spaces, and both the width and height of the maze won't exceed 100.
50
50
*/
51
- public class TheMaze {
51
+ public class _490 {
52
52
/**
53
53
* BFS: the key part of this algorithm is that: this is a ball that won't stop rolling until it hits a wall.
54
54
* This means we'll have to store all the empty spaces where the ball was forced to stop into the queue, these are
Original file line number Diff line number Diff line change 1
1
package com .fishercoder ;
2
2
3
- import com .fishercoder .solutions .TheMaze ;
3
+ import com .fishercoder .solutions ._490 ;
4
4
import org .junit .Before ;
5
5
import org .junit .BeforeClass ;
6
6
import org .junit .Test ;
7
7
8
8
import static junit .framework .Assert .assertEquals ;
9
9
10
- public class TheMazeTest {
11
- private static TheMaze test ;
10
+ public class _490Test {
11
+ private static _490 test ;
12
12
private static boolean expected ;
13
13
private static boolean actual ;
14
14
private static int [][] maze ;
@@ -17,7 +17,7 @@ public class TheMazeTest {
17
17
18
18
@ BeforeClass
19
19
public static void setup (){
20
- test = new TheMaze ();
20
+ test = new _490 ();
21
21
}
22
22
23
23
@ Before
You can’t perform that action at this time.
0 commit comments