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!
104104| 493| [ Reverse Pairs] ( https://leetcode.com/problems/reverse-pairs/ ) | [ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_493.java ) | O(?) | O(?) | Hard|
105105|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
106106|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
108108|488|[ Zuma Game] ( https://leetcode.com/problems/zuma-game/ ) |[ Solution] ( ../master/src/main/java/com/fishercoder/solutions/_488.java ) | O(?) |O(?) | Hard | DFS, Backtracking
109109|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
110110|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 4848 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.
4949 The maze contains at least 2 empty spaces, and both the width and height of the maze won't exceed 100.
5050 */
51- public class TheMaze {
51+ public class _490 {
5252 /**
5353 * BFS: the key part of this algorithm is that: this is a ball that won't stop rolling until it hits a wall.
5454 * 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 11package com .fishercoder ;
22
3- import com .fishercoder .solutions .TheMaze ;
3+ import com .fishercoder .solutions ._490 ;
44import org .junit .Before ;
55import org .junit .BeforeClass ;
66import org .junit .Test ;
77
88import static junit .framework .Assert .assertEquals ;
99
10- public class TheMazeTest {
11- private static TheMaze test ;
10+ public class _490Test {
11+ private static _490 test ;
1212 private static boolean expected ;
1313 private static boolean actual ;
1414 private static int [][] maze ;
@@ -17,7 +17,7 @@ public class TheMazeTest {
1717
1818 @ BeforeClass
1919 public static void setup (){
20- test = new TheMaze ();
20+ test = new _490 ();
2121 }
2222
2323 @ Before
You can’t perform that action at this time.
0 commit comments