Created
September 30, 2018 02:54
-
-
Save zhangxiaomu01/2c53df0d7113bc6fc71f9b2ab4de935d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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