status
date
slug
tags
category
type
password
icon
Linear DP
- Top-down: Recursion
- Bottom-up: Iteration
LeetCode 53. Maximum Subarray
LeetCode 300. Longest Increasing Subsequence
LeetCode 1143. Longest Common Subsequence
LeetCode 935. Knight Dialer
LeetCode 873. Length of Longest Fibonacci Subsequence
LeetCode 72. Edit Distance
LeetCode 221. Maximal Square
LeetCode 343. Integer Break
LeetCode 650. 2 Keys Keyboard
LeetCode 740. Delete and Earn
- 扁平化成 House Robber 問題
LeetCode 1027. Longest Arithmetic Subsequence
- 對於公差為負數的情況,可以將範圍整體平移成正數
LeetCode 718. Maximum Length of Repeated Subarray
LeetCode 368. Largest Divisible Subset
- 使用兩個 vector 來分別記錄最大長度以及轉移的 index
LeetCode 91. Decode Ways
LeetCode 1220. Count Vowels Permutation
LeetCode 338. Counting Bits
- 當 是奇數,必定是 ⇒ 多出來的 1 就是最後一個 bit
- 當 是偶數,必定是 ⇒ 將 右移一位變成 ,1 的個數不變
- Author:Zixu
- URL:https://zixu.us.kg/article/線性DP_隨筆
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!