Wildcard Matching
来源:互联网 发布:淘宝网.女士运动鞋. 编辑:程序博客网 时间:2024/06/01 10:32
public class Solution { public boolean isMatch(String s, String p) { int ids = 0, idp = 0, idstart = -1, idmatch = -1; while (ids < s.length()) { if (idp < p.length() && (s.charAt(ids) == p.charAt(idp) || p.charAt(idp) == '?')) { ids++; idp++; } else if (idp < p.length() && p.charAt(idp) == '*') { idstart = ids; idmatch = idp; idp++; } else if (idstart != -1) { idp = idmatch + 1; idstart++; ids = idstart; } else { return false; } } while (idp < p.length() && p.charAt(idp) == '*') { idp++; } return idp == p.length(); }}
0 0
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- Wildcard Matching
- HashTable
- C语言中输入输出重定,freopen()妙用。
- C - L1(大数比较)
- Kali linux安装漏洞扫描工具Nessus指南
- 跨海汇简介
- Wildcard Matching
- leetcode368. Largest Divisible Subset
- ToastUtil,一个阻止重复吐司并可控制位置的工具类
- 1045. Favorite Color Stripe (30)
- 通过simpleXML解析XML格式的数据 (两种方法)
- CodeForces 374A Inna and Pink Pony
- java.lang.NoClassDefFoundError: Could not initialize class org.apache.log4j.Log4
- 瞎搞
- Java 位运算(移位、位与、或、异或、非)