美文网首页
44. Wildcard Matching

44. Wildcard Matching

作者: xxxcoder | 来源:发表于2020-08-09 17:35 被阅读0次

algo 1

dynamic programming + one dim vector

dp: dp[i][j] whether p^{'} with length j match current substring of {s^{'}} of length i

the transformation equations follows as:

p[j-1] != '*' dp[i-1][j-1] && (s[i - 1] == dp[j - 1] || dp[j - 1] == ? )

p[j-1] == '*' dp[i][j - 1] || dp[i - 1][j]

相关文章

网友评论

      本文标题:44. Wildcard Matching

      本文链接:https://www.haomeiwen.com/subject/irkarktx.html