Toggle navigation
freeCookie
Home
Content
Welcome
Tags
freeCookie
freeCookie_🍪
Leetcode - Minimum Cost
LC322, LC983, LC1105, LC1155, LC1130
Minimum Cost 很多求在各种情况下的最小消耗问题,大概是背包九讲的多重背包问题。 322. Coin Change 很简单的从所有可行状态中寻找最少的。O(N * M), O(1). class Solution { public int coinChange(int...
Posted by freeCookie🍪 on August 25, 2019
Leetcode - Math Related
LC813, LC837, LC1058
Math Related DP 数学不好orz。这类DP的状态转换不是很好找。 813. Largest Sum of Averages O(N * N * K), O(N * K). class Solution { public double largestSumOfAve...
Posted by freeCookie🍪 on August 25, 2019
Leetcode - Longest Subsequence
LC300, LC376, LC673, LC516, LC1027, LC873, LC368, LC842, LC960
Longest Subsequence 300. Longest Increasing Subsequence 这堆题开始的地方。。。寻找最长递增子序列。这题的思路是维护一个lis序列,如果可以递增的增加数字进去,就增加,如果不可以的话就把lis里的数字更新。通过每次与res进行比较就能得...
Posted by freeCookie🍪 on August 25, 2019
Leetcode - Longest Subarray and Substring
LC718, LC647
Longest Subarray and Substring Subarray & Substring是连续的,比起subsequence的状态转换要简单一些。经常是O(N * N), O(N)的解法。 718. Maximum Length of Repeated Subarra...
Posted by freeCookie🍪 on August 25, 2019
Leetcode - House Robber / Subarray Product
LC198, LC213, LC337, LC740, LC152, LC713
House Robber Leetcode DP tag下的一个抢劫系列问题。解决方法是1d动态规划。 House Robber 抢劫,不能连续抢两个挨着的房子,求最大收益。两个状态,抢,不抢。O(N), O(1). class Solution { public int ro...
Posted by freeCookie🍪 on August 25, 2019
Leetcode - Dominoes
LC833,
Dominoes 838. Push Dominoes 这题蛮好的,问推倒多米诺之后的结果。然后用two pointer做了。对于每一段多米诺。如果这一段左右状态相同,那么这一段都是这个状态。否则根据这一段的长度是否为奇数更新结果中的相应部分。O(N), O(1). class Solu...
Posted by freeCookie🍪 on August 25, 2019
Leetcode - Buy and Sell Stock
LC121, LC122, LC123, LC188, LC309, LC714
Best Time to Buy and Sell Stock Leetcode DP tag下的一个买股票系列问题。解决方法是1d动态规划,只要能够想清楚状态转换还是很好解决的。 Best Time to Buy and Sell Stock I - Easy 限定一次交易,求所得最大...
Posted by freeCookie🍪 on August 25, 2019
LC刷题自我检讨
自我检讨
刷题几个月的自我检讨 8月份了,开始投简历和约面试了。打开job description依旧还是这么的虚。看一眼面经也不能保证立刻有思路。刷题的时候有时候会觉得思路来的很快,有时候又觉得无论怎么样都不会有思路。痛定思痛,可能是我还是太懈怠了。只注意刷题没有关注业界需要的skills,抱残守缺...
Posted by freeCookie🍪 on August 24, 2019
← Newer Posts
Older Posts →
FEATURED TAGS
Java
Hashset
Linkedhashset
BFS
Array
DFS
Hashmap
Design
ICC
DP
Stack
Python
Database
BinarySearch
ArrayList
SegmentTree
BIT
TopologicalSort
Bit
BST
TreeSet
TreeMap
Trie
String
LinkedList
KMP
D&C
Greedy
Math
Backtracking
Tree
UnionFind
TwoPointers
C/C++
GC
Web
Sort
Graph
DS
DL
PP
ML
Sampling
Minimax
Heap
ABOUT ME
~瞎拍脑袋写一切~
知
FRIENDS
兔子🐰
西瓜🍉
边美丽🌹
Truly