[LeetCode] 134: Wildcard Matching

来源:互联网 发布:win7无法打开软件 编辑:程序博客网 时间:2024/06/15 17:45
[Problem]

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") → falseisMatch("aa","aa") → trueisMatch("aaa","aa") → falseisMatch("aa", "*") → trueisMatch("aa", "a*") → trueisMatch("ab", "?*") → trueisMatch("aab", "c*a*b") → false

[Solution]

wait a moment

说明:版权所有,转载请注明出处。Coder007的博客
原创粉丝点击