mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
Update dynamic_programming/regex_match.py
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
parent
4456366da0
commit
8c5aef0497
@ -74,8 +74,6 @@ def dp_match(text: str, pattern: str) -> bool:
|
|||||||
dp = [[False for _ in range(n + 1)] for _ in range(m + 1)]
|
dp = [[False for _ in range(n + 1)] for _ in range(m + 1)]
|
||||||
dp[0][0] = True
|
dp[0][0] = True
|
||||||
|
|
||||||
for i in range(1, m + 1):
|
|
||||||
dp[i][0] = False
|
|
||||||
|
|
||||||
for j in range(1, n + 1):
|
for j in range(1, n + 1):
|
||||||
dp[0][j] = pattern[j - 1] == "*" and dp[0][j - 2]
|
dp[0][j] = pattern[j - 1] == "*" and dp[0][j - 2]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user