摘要:
https://leetcode.com/problems/shortest-completing-word/description/ 阅读全文
摘要:
https://leetcode.com/problems/01-matrix/description/ Use BFS to search. First I tried to BFS every 0, the problem is each 1 may need to be visited for 阅读全文
摘要:
https://leetcode.com/problems/find-eventual-safe-states/description/ 阅读全文
摘要:
https://leetcode.com/problems/maximum-width-of-binary-tree/description/ 阅读全文
摘要:
https://leetcode.com/problems/top-k-frequent-words/description/ 阅读全文
摘要:
https://leetcode.com/problems/expressive-words/description/ 阅读全文
摘要:
https://leetcode.com/problems/valid-parenthesis-string/description/ 这个题的难点在增加了*,*可能是(也可能是)。是(的前提是:右边有多余的)。是)的前提是:左边有多余的(。所以他们的位置信息是重要的。 Valid Parenthe 阅读全文
摘要:
Brute force (time out) Preprocess S: 阅读全文
摘要:
DP 阅读全文
摘要:
class Solution { public: double largestSumOfAverages(vector& A, int K) { int n = A.size(); // dp[k][i]: largestSumOfAverages of [0,i] with up to k partitions // d... 阅读全文