If we switch the order of these directions, it will not pass the Leetcode test any longer.
|
char[] dstr = {'u', 'd', 'l', 'r'}; |
|
int[][] dirs = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; |
While change the order:
char[] dstr = {'d', 'u', 'l', 'r'};
int[][] dirs = {{1, 0}, {-1, 0}, {0, -1}, {0, 1}};
test case failed: [[0,0,0,0,0],[1,1,0,0,1],[0,0,0,0,0],[0,1,0,0,1],[0,1,0,0,0]]
[4,3]
[0,1]
Output "dldul"
Expected "lul"
If we switch the order of these directions, it will not pass the Leetcode test any longer.
LeetCode/The Maze III.java
Lines 83 to 84 in bc10ad9
While change the order:
test case failed: [[0,0,0,0,0],[1,1,0,0,1],[0,0,0,0,0],[0,1,0,0,1],[0,1,0,0,0]]
[4,3]
[0,1]
Output "dldul"
Expected "lul"