Skip to content

Instantly share code, notes, and snippets.

@zhangxiaomu01
Created September 30, 2018 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhangxiaomu01/2c53df0d7113bc6fc71f9b2ab4de935d to your computer and use it in GitHub Desktop.
Save zhangxiaomu01/2c53df0d7113bc6fc71f9b2ab4de935d to your computer and use it in GitHub Desktop.
class Solution {
public:
bool isMatch(string s, string p) {
if(p.empty()) return s.empty();
bool myFirst = !s.empty() && (s[0] == p[0] || p[0] == '.');
return myFirst&&isMatch(s.substr(1),p.substr(1));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment