摘要:
10. 正则表达式匹配 题目链接 动态规划 class Solution { public boolean isMatch(String s, String p) { int n = s.length(); int m = p.length(); boolean[][] dp = new boole 阅读全文
摘要:
8. 字符串转换整数(atoi) 题目链接 直接模拟 class Solution { public int myAtoi(String s) { int ans = 0; int coefficient = 1; boolean hasFirst = false; for(char c : s.t 阅读全文
摘要:
7. 整数反转 题目链接 直接调用Java内置API class Solution { public int reverse(int x) { int coefficient = 1; if(x < 0){ coefficient = -1; x *= -1; } int ans = 0; try{ 阅读全文