Homepage
Open in app
Sign in
Get started
Array
Backtracking / DP / Greedy
Heap / Linked List
Two Pointers / Binary Search
Tree / Graph
Backend
Backtracking / DP / Greedy
[Leetcode Pattern] Dynamic Programming
[Leetcode Pattern] Dynamic Programming
A cheet sheet of dp problems in leetcode.
PHIL
May 17, 2022
[Leetcode] Jump Game
Problems of greedy algorithm are usually intuitively challenging. For this one, the high level concept is “while already able to jump…
PHIL
Mar 31, 2022
[Leetcode] Longest Consecutive Sequence
A special diversion of “the longest ….”. To make it O(n), let the pointer move rather than nested for loop.
PHIL
Mar 7, 2022
[Leetcode] Climbing Stairs
While the condition is as simple as the fib, this can be a good practice of dynamic programming.
PHIL
Mar 10, 2022
[Leetcode] Maximum Product Subarray
Advanced version of Maximum Subarray. As multiplying a negative switches max/min, instead of keeping the localMax, both max & min should be…
PHIL
Mar 12, 2022
[Leetcode] Best Time to Buy and Sell Stock
Greedy algorithm: Builds up a solution piece by piece, always choose a local optimal solution (the way with the best result in current…
PHIL
Mar 14, 2022
[Leetcode] Combination Sum
One of classic problems of combination/permutation. Combination means the sequence of elements in subset does not matter but which elments…
PHIL
Mar 14, 2022
[Leetcode] Coin Change
Do not think of what’s the answer for n. Instead, think of the answer for n - 1, n - 2, …, 1, and 0. We can always know the answer for 0…
PHIL
Mar 16, 2022
[Leetcode] Subsets
Subsets problems are just like combinations.
PHIL
Mar 21, 2022
[Leetcode] Palindromic Substrings
A palindrome is same backward as forward. Also, a palindrome will still be palindrome after removing head and tail. Hence, this is a…
PHIL
Mar 21, 2022
About Coding Memo
Latest Stories
Archive
About Medium
Terms
Privacy
Teams