
动态规划
dp
zing_2
行云流水,任意所致
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
最长有效括号-动态规划
leetcode题解题目描述class Solution { public int longestValidParentheses(String s) { int len=s.length(); if(len==0){ return 0; } int[] dp=new int[len]; dp[0]=0; for(int i=1;i<len;i++){原创 2021-05-25 11:36:49 · 119 阅读 · 0 评论 -
正则表达式匹配-动态规划
https://leetcode-cn.com/problems/regular-expression-matching/solution/zheng-ze-biao-da-shi-pi-pei-by-leetcode-solution/class Solution { public boolean isMatch(String s, String p) { int m=s.length();int n=p.length(); boolean[][] dp=new.原创 2021-05-24 12:43:59 · 133 阅读 · 0 评论 -
最长回文子串
给你一个字符串 s,找到 s 中最长的回文子串给你一个字符串 s,找到 s 中最长的回文子串。示例 1:输入:s = “babad”输出:“bab”解释:“aba” 同样是符合题意的答案。示例 2:输入:s = “cbbd”输出:“bb”示例 3:输入:s = “a”输出:“a”public class Solution { public String longestPalindrome(String s) { int len=s.length原创 2021-05-21 23:16:10 · 160 阅读 · 0 评论