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 {
66 dp[text.length][pattern.length] = true
77 for (i in text.length downTo 0 ) {
88 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] == ' .' ))
1010 if (j + 1 < pattern.length && pattern[j + 1 ] == ' *' ) {
1111 dp[i][j] = dp[i][j + 2 ] || firstMatch && dp[i + 1 ][j]
1212 } else {
Original file line number Diff line number Diff line change @@ -52,8 +52,6 @@ class Solution {
5252 sb.append(cOne)
5353 }
5454 1 -> sb.append(cOne)
55- else -> {
56- }
5755 }
5856 return num - div * one
5957 }
You can’t perform that action at this time.
0 commit comments