From dcb7a56d7ede90b70b45898812b02f8d3aee4c1b Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Tue, 8 Oct 2024 11:08:17 +0800 Subject: [PATCH] update --- src/wildcard_match/wildcard_match.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wildcard_match/wildcard_match.cpp b/src/wildcard_match/wildcard_match.cpp index 729fe84..3261848 100644 --- a/src/wildcard_match/wildcard_match.cpp +++ b/src/wildcard_match/wildcard_match.cpp @@ -18,9 +18,10 @@ int main(){ dp[0][0] = true; for(const size_t j:range((size_t)1,p.size()+1)){ - if(get_p(j)=='*'){ - dp[0][j] = dp[0][j-1]; + if(get_p(j)!='*'){ + break; } + dp[0][j]=true; } for(const size_t i:range((size_t)1,s.size()+1)){