From 3ec5475080c540712d8487368e2aaae9ce5a2974 Mon Sep 17 00:00:00 2001 From: CyC2018 <1029579233@qq.com> Date: Mon, 19 Mar 2018 15:45:02 +0800 Subject: [PATCH] auto commit --- notes/剑指 offer 题解.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/notes/剑指 offer 题解.md b/notes/剑指 offer 题解.md index c69a68b5..992c1136 100644 --- a/notes/剑指 offer 题解.md +++ b/notes/剑指 offer 题解.md @@ -878,9 +878,9 @@ p.charAt(j) == '.' : dp[i][j] = dp[i-1][j-1]; p.charAt(j) == '*' : p.charAt(j-1) != s.charAt(i) : dp[i][j] = dp[i][j-2] // in this case, a* only counts as empty p.charAt(j-1) == s.charAt(i) or p.charAt(i-1) == '.': - dp[i][j] = dp[i-1][j] // in this case, a* counts as multiple a - or dp[i][j] = dp[i][j-1] // in this case, a* counts as single a - or dp[i][j] = dp[i][j-2] // in this case, a* counts as empty + dp[i][j] = dp[i-1][j] // in this case, a* counts as multiple a + or dp[i][j] = dp[i][j-1] // in this case, a* counts as single a + or dp[i][j] = dp[i][j-2] // in this case, a* counts as empty ``` ```java @@ -920,8 +920,7 @@ public boolean match(char[] str, char[] pattern) { ```java public boolean isNumeric(char[] str) { - String string = String.valueOf(str); - return string.matches("[\\+-]?[0-9]*(\\.[0-9]*)?([eE][\\+-]?[0-9]+)?"); + return new String(str).matches("[+-]?\\d*(\\.\\d+)?([eE][+-]?\\d+)?"); } ```