Skip to content

Commit 39d9308

Browse files
committed
replace bit mask from '#' to blank
1 parent 398670b commit 39d9308

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

word-search/YuuuuuuYu.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* Runtime: 130ms
2+
* Runtime: 128ms
33
* Time Complexity: O(m x n x 4^l)
44
* - m: board의 행 길이
55
* - n: board의 열 길이
66
* - l: word의 길이
77
*
8-
* Memory: 42.32MB
8+
* Memory: 42.69MB
99
* Space Complexity: O(l)
1010
*
1111
* Approach: DFS + 백트래킹
@@ -37,14 +37,14 @@ public boolean exist(char[][] board, String word) {
3737
return false;
3838
}
3939

40-
private boolean dfs(char[][] board, int x, int y, int index, String word) {
40+
boolean dfs(char[][] board, int x, int y, int index, String word) {
4141
if (index == word.length()-1) {
4242
return true;
4343
}
4444

4545
char temp = board[x][y];
4646
char nextChar = word.charAt(index+1);
47-
board[x][y] = '#';
47+
board[x][y] = ' ';
4848

4949
for (int i=0; i<4; i++) {
5050
int nx = x+dx[i];

0 commit comments

Comments
 (0)