![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
#DP
TechJungle
这个作者很懒,什么都没留下…
展开
-
九章算法 强化 Lecture 5 DP上滚动数组 划分型 博弈型 区间型
滚动数组110确定状态研究最优策略的最后一步转化为子问题转移方程根据子问题定义直接得到初始条件和边界情况仔细,考虑周全计算顺序利用之前的计算结果划分型动态规划512676博弈动态规划395区间型动态规划求一段区间的最大最小值168...原创 2020-03-02 05:16:43 · 181 阅读 · 0 评论 -
LeetCode String 32 Longest Valid Parentheses
32. Longest Valid ParenthesesGiven a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: “(()”Output: 2Exp...原创 2019-12-20 11:08:00 · 158 阅读 · 0 评论 -
LeetCode String 22 Generate Parentheses
22. Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[“((()))”,“(()())”,“(()...原创 2019-12-20 01:13:19 · 101 阅读 · 0 评论 -
LeetCode String 5 Longest Palindromic Substring
5. Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: “babad”Output: “bab”Note: “aba”...原创 2019-12-19 10:41:23 · 96 阅读 · 0 评论 -
LeetCode String 38 Count and Say
38. Count and SayThe count-and-say sequence is the sequence of integers with the first five terms as following:1112112111112211 is read off as “one 1” or 11.11 is read off as ...原创 2019-12-01 12:46:49 · 76 阅读 · 0 评论 -
LeetCode String 87 Scramble String
87. Scramble StringGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = “great”:To scramb...原创 2019-12-01 01:43:13 · 86 阅读 · 0 评论 -
LeetCode Array 42 Trapping Rain Water
42. Trapping Rain WaterGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.The above elevation map ...原创 2019-11-17 08:02:15 · 78 阅读 · 0 评论 -
LeetCode Array 123 188 Best Time to Buy and Sell Stock III IV
123. Best Time to Buy and Sell Stock IIISay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at mos...原创 2019-11-16 14:45:42 · 113 阅读 · 0 评论 -
LeetCode Array 55 Jump Game
55. Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Det...原创 2019-11-16 14:44:48 · 114 阅读 · 0 评论 -
LeetCode Array 45 Jump Game II
45. Jump Game IIGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position....原创 2019-11-16 14:44:18 · 77 阅读 · 0 评论 -
LeetCode Array 121 122 Best Time to Buy and Sell Stock I II
Array121. Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e.,...原创 2019-11-16 14:43:26 · 66 阅读 · 0 评论 -
LeetCode Array 309 Best Time to Buy and Sell Stock with Cooldown
309. Best Time to Buy and Sell Stock with CooldownSay you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may compl...原创 2019-11-16 14:41:20 · 100 阅读 · 0 评论