Regular Expression Matching
来源:互联网 发布:pdf.js跨域请求file 编辑:程序博客网 时间:2024/05/22 06:32
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
- First Bad Version
- QT Creator编译出现"常量中有换行符"解决.
- 将 Django 作为 bootstrap 的后台框架
- Unity中Navigation组件的使用代码范例和注意事项
- Gridview 自定义测量高度
- Regular Expression Matching
- C++使用for和foreach,g++编译C++11程序
- 梦想起航
- php 一个验证码类的改写
- Two Sum
- 在cpython中运行py文件
- 作用域链
- 成员访问权限
- 边缘检测函数:Canny() Sobel() Laplacian()scharr滤波器