'.'
and '*'
.
方法:递归
递归逐个字符比较:每次要比较的时候先判断比较的字符后面的一个字符是不是'*', 例如A=aa和B=a**b是否匹配的时候,在判断第一个字符是否匹配之前先判断B中第二字符是否为'*'。
wx604f04a92c6fd 博主文章分类:leetcode题目解析 ©著作权
'.'
and '*'
.
方法:递归
递归逐个字符比较:每次要比较的时候先判断比较的字符后面的一个字符是不是'*', 例如A=aa和B=a**b是否匹配的时候,在判断第一个字符是否匹配之前先判断B中第二字符是否为'*'。
下一篇:算法----冒泡排序算法
【LeetCode】39. 组合总和
【LeetCode】705. 设计哈希集合
【LeetCode】706. 设计哈希映射
https://leetcode.com/problems/reg
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*'
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M