摘要: https://leetcode.com/problems/shortest-completing-word/description/ 阅读全文
posted @ 2018-05-04 08:25 JTechRoad 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2018-05-04 00:02 JTechRoad 阅读(132) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/find-eventual-safe-states/description/ 阅读全文
posted @ 2018-05-03 14:22 JTechRoad 阅读(143) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/maximum-width-of-binary-tree/description/ 阅读全文
posted @ 2018-05-03 13:55 JTechRoad 阅读(130) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/top-k-frequent-words/description/ 阅读全文
posted @ 2018-05-03 13:17 JTechRoad 阅读(149) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/expressive-words/description/ 阅读全文
posted @ 2018-05-03 13:01 JTechRoad 阅读(271) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/valid-parenthesis-string/description/ 这个题的难点在增加了*,*可能是(也可能是)。是(的前提是:右边有多余的)。是)的前提是:左边有多余的(。所以他们的位置信息是重要的。 Valid Parenthe 阅读全文
posted @ 2018-05-03 08:30 JTechRoad 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Brute force (time out) Preprocess S: 阅读全文
posted @ 2018-05-02 23:44 JTechRoad 阅读(121) 评论(0) 推荐(0) 编辑
摘要: DP 阅读全文
posted @ 2018-05-02 12:41 JTechRoad 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2018-05-02 02:47 JTechRoad 阅读(248) 评论(0) 推荐(0) 编辑