Skip to content

Commit b0a8bd7

Browse files
authored
Update README_EN.md
1 parent 85a7c0d commit b0a8bd7

File tree

1 file changed

+1
-1
lines changed
  • solution/3400-3499/3407.Substring Matching Pattern

1 file changed

+1
-1
lines changed

solution/3400-3499/3407.Substring Matching Pattern/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ tags:
8080

8181
### Solution 1: String Matching
8282

83-
According to the problem description, '_' can be replaced by any sequence of zero or more characters, so we can split the pattern string $p$ by `_` into several substrings. If these substrings appear in order in the string $s$, then $p$ can become a substring of $s$.
83+
According to the problem description, `*` can be replaced by any sequence of zero or more characters, so we can split the pattern string $p$ by `*` into several substrings. If these substrings appear in order in the string $s$, then $p$ can become a substring of $s$.
8484

8585
Therefore, we first initialize a pointer $i$ to the start of string $s$, then iterate over each substring $t$ obtained by splitting the pattern string $p$ by `*`. For each $t$, we search for it in $s$ starting from position $i$. If it is found, we move the pointer $i$ to the end of $t$ and continue searching for the next substring. If it is not found, it means the pattern string $p$ cannot become a substring of $s$, and we return $\text{false}$. If all substrings are found, we return $\text{true}$.
8686

0 commit comments

Comments
 (0)