![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
明灵暗尘
这个作者很懒,什么都没留下…
展开
-
Leetcode_DP_198_HouseRobber
CatalogureDescriptionThinkingCodeDescriptionThinkingInitial State: dp[0] = nums[0], dp[1] = nums[1];State Transformation Equation: dp[i] = max{dp[i-1], dp[i-2]+nums[i]};Codeclass Solution {pu...原创 2019-07-29 13:11:19 · 89 阅读 · 0 评论 -
Leetcode_DP_53_MaximumSubarray
CatalogueDescriptionThinkingState transformation equationCodeDescriptionThinkingState transformation equationdp[i] = max{num[i], dp[i-1]+dp[i-1]}Codeclass Solution {public: int maxSubArra...原创 2019-07-28 20:57:11 · 84 阅读 · 0 评论 -
Leetcode_DP_303_RangeSumQuery(Immutable)
CatalogueDescriptionThinkingCodeDescriptionThinkingViolent SolutionCreating a two-dimensional array dp where dp[i][j] denotes the sum of the elements between indices i and j.Dynamic Programmi...原创 2019-07-28 19:25:21 · 75 阅读 · 0 评论 -
Leetcode_DP_121_BestTimeToBuyAndSellStock
CatalogueDescriptionThinkingState: dp[i], dp[1] = false, dp[2] = true;Transformation equation:dp[i] = (N / j == 0 && dp[j]) ?? true : false;CodeDescriptionThinkingLet us assume a one-dimen...原创 2019-07-28 16:46:20 · 76 阅读 · 0 评论 -
Leetcode_DP(level_M)_413_ArithmeticSlices
CatalogueDescriptionThinkingCodeDescriptionThinkingViolent solutioni traverses from 1 to n while j traverses from i-1 to 0. When j+1 equal to i, the default equal difference is A[i] - A[j], and ...原创 2019-08-01 20:59:27 · 88 阅读 · 0 评论 -
Leetcode_DP(level_M)_712_MinimumASCIIDeleteSumForTwoStrings
CatalogueDescriptionThinkingCodeDescriptionThinkingTips: We will traverse both of two strings, if s1[i] != s2[j], we must delete one of them to minimize the ASCII.State: dp[i][j] denotes the mini...原创 2019-08-01 00:04:46 · 89 阅读 · 0 评论 -
Leetcode_DP(level_M)_647_PalindromicSubstrings
CatalogueDescriptionThinkingCodeDescriptionThinkingPlan A (Two-dimensional, from top to bottom)State: dp[i][j] denotes whether the substring whose indices from i to j is a palindrom.Transformati...原创 2019-07-31 21:32:07 · 95 阅读 · 0 评论 -
Leetcode_DP(level_M)_120_Triangle
CatalogueDescriptionThinkingDescriptionThinkingPlan A (Two-dimensional, from top to bottom)State: dp[i][j] denotes the minimum distance from top to triangle[i][j]Transformation equation : dp[i][...原创 2019-07-31 19:56:59 · 89 阅读 · 0 评论 -
Leetcode_DP(level_M)_877_StoneGame
CatalogueDescriptionThinkingCodeConclusionDescriptionThinkingSorry, I have no idea yet about how to solve this problem with a one-dimensional array right now. Maybe I’ll follow up at another time ...原创 2019-07-29 17:02:43 · 125 阅读 · 0 评论 -
Leetcode_UnionFind(level_M)_200_547
CatalogueDescription_200_number-of-islandsDescription_547_friend-circlesThinkingCodeDescription_200_number-of-islandsDescription_547_friend-circlesThinkingSomething In CommonBoth of two questio...原创 2019-08-08 21:41:20 · 148 阅读 · 0 评论