diff --git a/src/wildcard_match/wildcard_match.cpp b/src/wildcard_match/wildcard_match.cpp index 5c62e89..729fe84 100644 --- a/src/wildcard_match/wildcard_match.cpp +++ b/src/wildcard_match/wildcard_match.cpp @@ -25,7 +25,7 @@ int main(){ for(const size_t i:range((size_t)1,s.size()+1)){ for(const size_t j:range((size_t)1,p.size()+1)){ - if(get_p(j) == get_s(j) || get_p(j)=='?'){ + if(get_s(i) == get_p(j) || get_p(j)=='?'){ dp[i][j] = dp[i-1][j-1]; }else if(get_p(j)=='*'){ dp[i][j] = dp[i-1][j] || dp[i][j-1]; //01背包,查看是否使用这个字符