File tree Expand file tree Collapse file tree 2 files changed +1
-3
lines changed
src/main/kotlin/g0001_0100
s0010_regular_expression_matching Expand file tree Collapse file tree 2 files changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class Solution {
6
6
dp[text.length][pattern.length] = true
7
7
for (i in text.length downTo 0 ) {
8
8
for (j in pattern.length - 1 downTo 0 ) {
9
- val firstMatch = (( i < text.length && ((pattern[j] == text[i] || pattern[j] == ' .' )) ))
9
+ val firstMatch = i < text.length && ((pattern[j] == text[i] || pattern[j] == ' .' ))
10
10
if (j + 1 < pattern.length && pattern[j + 1 ] == ' *' ) {
11
11
dp[i][j] = dp[i][j + 2 ] || firstMatch && dp[i + 1 ][j]
12
12
} else {
Original file line number Diff line number Diff line change @@ -52,8 +52,6 @@ class Solution {
52
52
sb.append(cOne)
53
53
}
54
54
1 -> sb.append(cOne)
55
- else -> {
56
- }
57
55
}
58
56
return num - div * one
59
57
}
You can’t perform that action at this time.
0 commit comments