Regular Expression Matching
来源:互联网 发布:打电话不要钱的软件 编辑:程序博客网 时间:2024/04/30 19:25
南海是我们的,为南海而刷题,刷刷刷
public class Solution { public boolean isMatch(String s, String p) { if (p.length() == 0) { return s.length() == 0; } else if (p.length() == 1 || p.charAt(1) != '*') { if (s.length() == 0) { return false; } else if ((s.charAt(0) != p.charAt(0)) && (p.charAt(0) != '.')) { return false; } else { return isMatch(s.substring(1), p.substring(1)); } } else { if (isMatch(s, p.substring(2))) { return true; } for (int i = 0; i < s.length() && (s.charAt(i) == p.charAt(0) || p.charAt(0) == '.'); i++) { if (isMatch(s.substring(i + 1), p.substring(2))) { return true; } } return false; } }}
0 0
- LeetCode: Regular Expression Matching
- LeetCode: Regular Expression Matching
- leetcode Regular Expression Matching
- [Leetcode] Regular Expression Matching
- Regular Expression Matching
- Regular Expression Matching
- [LeetCode]Regular Expression Matching
- Regular Expression Matching
- LeetCode-Regular Expression Matching
- Regular Expression Matching
- Regular Expression Matching LeetCode
- Regular Expression Matching
- LeetCode | Regular Expression Matching
- LeetCode: Regular Expression Matching
- Leetcode: Regular Expression Matching
- [LeetCode] Regular Expression matching
- [LeetCode] Regular Expression Matching
- LeetCode Regular Expression Matching
- 小小的细节错误浪费一天
- 一段简短的csv读取代码
- 分布式网站架构后续:zookeeper技术浅析
- 硅谷产品联盟合伙人:每一个伟大产品的背后
- windows下编译py-faster-rcnn
- Regular Expression Matching
- 使用OC通过数组来存放图片并加按钮使之能够切换照片
- Activity跳转动画
- 一种 View 缓存的做法
- 多线程下载
- ubuntu上修改mysql默认字符编码出现的Job failed to start解决方法
- SSI与Velocity解析时的区别
- Js面向对象编程之属性特性
- CentOS常用命令