觉得Wildcard Matching & Regular Expression Matching & KMP都是字符串匹配问题,所以想把它们放一起
方法有动态规划、回溯、有限自动机
一、Wildcard Matching:
Implement wildcard pattern matching with support for '?'
and '*'
.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
The function prototype should be:
bool isMatch(const char *s, const char *p)
Some examples:
isMatch("aa","a") → false
isMatch("aa","aa") → tr