Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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