Leetcode Round 4 记录
完全没有思路
1. Sudoku Solver
2. Unique BST II [递归思路]
3. Sorted List to BST [O(n)时间复杂度]
4. Surrounded Regions [DFS转BFS]
5. palindrome partitioning II [dp递推式]
6. Gas Station []
7. Candy [{4, 2, 3, 4, 1}]
8. Best Time to Buy and Sell Stock IV [dp状态转移方程]
9. Minimum Size Subarray Sum [两指针方法,注意记录最小值]
10. Contains Duplicate III [TreeSet数据结构]
提交多次才通过
1. Palindrome Number
2. Regular Expression Matching
3. Jump Game II [贪心的条件]
4. Decode Ways [110, 100, 0]
5. Clone Graph [BFS过程中,如何将未被访问过的node加入到queue中]
6. Repeated DNA Sequence [编码方式, 输出结果判重]
7. Course Schedule I [最小堆, bfs]
8. Word Search II [Trie优化,注意存visited矩阵]
小陷阱题
1. First Missing Positive Number. [死循环的case: {1, 1}]
2. Sqrt [int相乘要使用long来存储,防止越界]
3. reverse words [双指针法]