标签:pat || turn span 字符 实现 col lse tle
class Solution { public: bool match(char *str, char *pattern) { if (*str == ‘\0‘ && *pattern == ‘\0‘) return true; if (*str != ‘\0‘ && *pattern == ‘\0‘) return false; if (*(pattern + 1) != ‘*‘) { if (*str == *pattern || (*str != ‘\0‘ && *pattern == ‘.‘)) return match(str + 1, pattern + 1); else return false; } else { if (*str == *pattern || (*str != ‘\0‘ && *pattern == ‘.‘)) return match(str, pattern + 2) || match(str + 1, pattern); else return match(str, pattern + 2); } } };
标签:pat || turn span 字符 实现 col lse tle
原文地址:https://www.cnblogs.com/ruoh3kou/p/10193331.html