Skip to content

Commit 07411bf

Browse files
committed
Improved task 3393
1 parent 6911887 commit 07411bf

File tree

1 file changed

+2
-7
lines changed
  • src/main/kotlin/g3301_3400/s3393_count_paths_with_the_given_xor_value

1 file changed

+2
-7
lines changed

src/main/kotlin/g3301_3400/s3393_count_paths_with_the_given_xor_value/Solution.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package g3301_3400.s3393_count_paths_with_the_given_xor_value
22

3-
// #Medium #2024_12_22_Time_72_ms_(100.00%)_Space_71.2_MB_(100.00%)
3+
// #Medium #2024_12_30_Time_57_(68.42%)_Space_73.12_(52.63%)
44

55
class Solution {
66
private var m = -1
@@ -10,12 +10,7 @@ class Solution {
1010
fun countPathsWithXorValue(grid: Array<IntArray>, k: Int): Int {
1111
m = grid.size
1212
n = grid[0].size
13-
dp = Array<Array<IntArray>>(m) { Array<IntArray>(n) { IntArray(16) } }
14-
for (a in dp) {
15-
for (b in a) {
16-
b.fill(-1)
17-
}
18-
}
13+
dp = Array(m) { Array(n) { IntArray(16) { -1 } } }
1914
return dfs(grid, 0, k, 0, 0)
2015
}
2116

0 commit comments

Comments
 (0)