# algorithm **Repository Path**: shellbotcheng/algorithm ## Basic Information - **Project Name**: algorithm - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-15 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 算法每日一练 * 这个专栏是Hollis知识星球的朋友们练习算法的地方,同时也欢迎广大网友参与 * 所有题目来源是[leetCode](https://leetcode-cn.com/problemset/all/)官方公开题库 ### 初学者友好的算法题目解答 * 算法解答部分的代码注释细致到每一行 * 希望能为初学者提供最大的便利去理解每道题目和解法 * 欢迎网友为本项目做贡献,提交你的解题方法和详细解释 --- ### 专题列表 * 2018年11月27日~2019年01月16日 >[《算法面试通关40讲》专题](https://time.geekbang.org/course/intro/130) >[《算法面试通关40讲》官方课件](https://github.com/geektime-geekbang/algorithm-1) * 2018年11月16日 >LeetCode动态规划专题 --- 专题(Begin):《算法面试40讲》 --- 2018年11月27日 [206. 反转链表](https://github.com/hollischuang/algorithm/tree/master/leetcode/206-reverseLinkedList) [https://leetcode-cn.com/problems/reverse-linked-list/](https://leetcode-cn.com/problems/reverse-linked-list/) 英文官方题解: [https://leetcode.com/articles/reverse-linked-list/](https://leetcode.com/articles/reverse-linked-list/) 知识点:数组、链表 难度:简单 --- 2018年11月28日 [24. 两两交换链表中的节点](https://github.com/hollischuang/algorithm/tree/master/leetcode/024-swapNodesInPairs) [https://leetcode-cn.com/problems/swap-nodes-in-pairs/](https://leetcode-cn.com/problems/swap-nodes-in-pairs/) 无官方题解,网友最高票Java解法: [https://leetcode.com/problems/swap-nodes-in-pairs/discuss/11030/My-accepted-java-code.-used-recursion.](https://leetcode.com/problems/swap-nodes-in-pairs/discuss/11030/My-accepted-java-code.-used-recursion.) 知识点:数组、链表 难度:中等 --- 2018年11月29日 [141. 环形链表](https://github.com/hollischuang/algorithm/tree/master/leetcode/141-linkedListCycle) [https://leetcode-cn.com/problems/linked-list-cycle/](https://leetcode-cn.com/problems/linked-list-cycle/) 官方题解: [https://leetcode-cn.com/articles/linked-list-cycle/](https://leetcode-cn.com/articles/linked-list-cycle/) 知识点:数组、链表 难度:简单 --- 2018年11月30日 [142. 环形链表 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/142-linkedListCycleII) [https://leetcode-cn.com/problems/linked-list-cycle-ii/](https://leetcode-cn.com/problems/linked-list-cycle-ii/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/linked-list-cycle-ii/discuss/44774/Java-O(1)-space-solution-with-detailed-explanation.](https://leetcode.com/problems/linked-list-cycle-ii/discuss/44774/Java-O(1)-space-solution-with-detailed-explanation.) 知识点:数组、链表 难度:中等 --- 2018年12月01日 [25. k个一组翻转链表](https://github.com/hollischuang/algorithm/tree/master/leetcode/025-reverseNodesInKGroup) [https://leetcode-cn.com/problems/reverse-nodes-in-k-group/](https://leetcode-cn.com/problems/reverse-nodes-in-k-group/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/reverse-nodes-in-k-group/discuss/11423/Short-but-recursive-Java-code-with-comments](https://leetcode.com/problems/reverse-nodes-in-k-group/discuss/11423/Short-but-recursive-Java-code-with-comments) 知识点:数组、链表 难度:困难 --- 2018年12月02日 [20. 有效的括号](https://github.com/hollischuang/algorithm/tree/master/leetcode/020-validParentheses) [https://leetcode-cn.com/problems/valid-parentheses/](https://leetcode-cn.com/problems/valid-parentheses/) 官方题解: [https://leetcode-cn.com/articles/valid-parentheses/](https://leetcode-cn.com/articles/valid-parentheses/) 知识点:堆栈、队列 难度:简单 --- 2018年12月03日 [232. 用栈实现队列](https://github.com/hollischuang/algorithm/tree/master/leetcode/232-implementQueueUsingStacks) [https://leetcode-cn.com/problems/implement-queue-using-stacks/](https://leetcode-cn.com/problems/implement-queue-using-stacks/) 英文官方题解: [https://leetcode.com/articles/implement-queue-using-stacks/](https://leetcode.com/articles/implement-queue-using-stacks/) 知识点:堆栈、队列 难度:简单 --- 2018年12月04日 [225. 用队列实现栈](https://github.com/hollischuang/algorithm/tree/master/leetcode/225-implementStackUsingQueues) [https://leetcode-cn.com/problems/implement-stack-using-queues/](https://leetcode-cn.com/problems/implement-stack-using-queues/) 英文官方题解: [https://leetcode.com/articles/implement-stack-using-queues/](https://leetcode.com/articles/implement-stack-using-queues/) 知识点:堆栈、队列 难度:简单 --- 2018年12月05日 [844. 比较含退格的字符串](https://github.com/hollischuang/algorithm/tree/master/leetcode/844-BackspaceStringCompare) [https://leetcode-cn.com/problems/backspace-string-compare/](https://leetcode-cn.com/problems/backspace-string-compare/) 英文官方题解: [https://leetcode.com/articles/backspace-string-compare/](https://leetcode.com/articles/backspace-string-compare/) 知识点:堆栈、队列 难度:简单 --- 2018年12月06日 [703. 数据流中的第K大元素](https://github.com/hollischuang/algorithm/tree/master/leetcode/703-KthLargestElementInAStream) [https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/](https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/kth-largest-element-in-a-stream/discuss/149050/Java-Priority-Queue](https://leetcode.com/problems/kth-largest-element-in-a-stream/discuss/149050/Java-Priority-Queue) 知识点:优先队列 难度:简单 --- 2018年12月07日 [692. 前K个高频单词](https://github.com/hollischuang/algorithm/tree/master/leetcode/692-TopKFrequentWords) [https://leetcode-cn.com/problems/top-k-frequent-words/](https://leetcode-cn.com/problems/top-k-frequent-words/) 英文官方题解: [https://leetcode.com/articles/top-k-frequent-words/](https://leetcode.com/articles/top-k-frequent-words/) 知识点:优先队列 难度:中等 --- 2018年12月08日 [239. 滑动窗口最大值](https://github.com/hollischuang/algorithm/tree/master/leetcode/239-slidingWindowMaximum) [https://leetcode-cn.com/problems/sliding-window-maximum/](https://leetcode-cn.com/problems/sliding-window-maximum/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/sliding-window-maximum/discuss/65884/Java-O(n)-solution-using-deque-with-explanation](https://leetcode.com/problems/sliding-window-maximum/discuss/65884/Java-O(n)-solution-using-deque-with-explanation) 知识点:优先队列 难度:困难 --- 2018年12月09日 [242. 有效的字母异位词](https://github.com/hollischuang/algorithm/tree/master/leetcode/242-ValidAnagram) [https://leetcode-cn.com/problems/valid-anagram/](https://leetcode-cn.com/problems/valid-anagram/) 英文官方题解: [https://leetcode.com/articles/valid-anagram/](https://leetcode.com/articles/valid-anagram/) 知识点:哈希表和集合 难度:简单 --- 2018年12月10日 [1. 两数之和](https://github.com/hollischuang/algorithm/tree/master/leetcode/001-twoSum) [https://leetcode-cn.com/problems/two-sum/](https://leetcode-cn.com/problems/two-sum/) 官方题解: [https://leetcode-cn.com/articles/two-sum/](https://leetcode-cn.com/articles/two-sum/) 知识点:哈希表和集合 难度:简单 --- 2018年12月11日 [15. 三数之和](https://github.com/hollischuang/algorithm/tree/master/leetcode/015-threeSum) [https://leetcode-cn.com/problems/3sum/](https://leetcode-cn.com/problems/3sum/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/3sum/discuss/7380/Concise-O(N2)-Java-solution](https://leetcode.com/problems/3sum/discuss/7380/Concise-O(N2)-Java-solution) 知识点:哈希表和集合 难度:中等 --- 2018年12月12日 [98. 验证二叉搜索树](https://github.com/hollischuang/algorithm/tree/master/leetcode/098-validateBinarySearchTree) [https://leetcode-cn.com/problems/validate-binary-search-tree/](https://leetcode-cn.com/problems/validate-binary-search-tree/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/validate-binary-search-tree/discuss/32112/Learn-one-iterative-inorder-traversal-apply-it-to-multiple-tree-questions-(Java-Solution)](https://leetcode.com/problems/validate-binary-search-tree/discuss/32112/Learn-one-iterative-inorder-traversal-apply-it-to-multiple-tree-questions-(Java-Solution)) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/validate-binary-search-tree/discuss/32109/My-simple-Java-solution-in-3-lines](https://leetcode.com/problems/validate-binary-search-tree/discuss/32109/My-simple-Java-solution-in-3-lines) 知识点:树、二叉树、二叉搜索树 难度:中等 --- 2018年12月13日 [236. 二叉树的最近公共祖先](https://github.com/hollischuang/algorithm/tree/master/leetcode/236-lowestCommonAncestorOfABinaryTree) [https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-tree/) 英文官方题解: [https://leetcode.com/articles/lowest-common-ancestor-of-a-binary-tree/](https://leetcode.com/articles/lowest-common-ancestor-of-a-binary-tree/) 知识点:树、二叉树、二叉搜索树 难度:中等 --- 2018年12月14日 [50. Pow(x, n)](https://github.com/hollischuang/algorithm/tree/master/leetcode/050-powxN) [https://leetcode-cn.com/problems/powx-n/](https://leetcode-cn.com/problems/powx-n/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/powx-n/discuss/19546/Short-and-easy-to-understand-solution](https://leetcode.com/problems/powx-n/discuss/19546/Short-and-easy-to-understand-solution) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/powx-n/discuss/19544/5-different-choices-when-talk-with-interviewers](https://leetcode.com/problems/powx-n/discuss/19544/5-different-choices-when-talk-with-interviewers) 知识点:递归、分治 难度:中等 --- 2018年12月15日 [169. 求众数](https://github.com/hollischuang/algorithm/tree/master/leetcode/169-majorityElement) [https://leetcode-cn.com/problems/majority-element/](https://leetcode-cn.com/problems/majority-element/) 英文官方题解: [https://leetcode.com/articles/majority-element/](https://leetcode.com/articles/majority-element/) 知识点:递归、分治 难度:简单 --- 2018年12月16日 [53. 最大子序和](https://github.com/hollischuang/algorithm/tree/master/leetcode/053-maximumSubarray) [https://leetcode-cn.com/problems/maximum-subarray/](https://leetcode-cn.com/problems/maximum-subarray/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/maximum-subarray/discuss/20193/DP-solution-and-some-thoughts](https://leetcode.com/problems/maximum-subarray/discuss/20193/DP-solution-and-some-thoughts) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/maximum-subarray/discuss/20211/Accepted-O(n)-solution-in-java](https://leetcode.com/problems/maximum-subarray/discuss/20211/Accepted-O(n)-solution-in-java) 知识点:递归、分治、动态规划 难度:简单 --- 2018年12月17日 [860. 柠檬水找零](https://github.com/hollischuang/algorithm/tree/master/leetcode/860-lemonadeChange) [https://leetcode-cn.com/problems/lemonade-change/](https://leetcode-cn.com/problems/lemonade-change/) 官方题解: [https://leetcode-cn.com/articles/lemonade-change/](https://leetcode-cn.com/articles/lemonade-change/) 知识点:贪心算法 难度:简单 --- 2018年12月18日 [122. 买卖股票的最佳时机 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/122-bestTimeToBuyAndSellStockII) [https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/) 官方题解: [https://leetcode-cn.com/articles/best-time-to-buy-and-sell-stock-ii/](https://leetcode-cn.com/articles/best-time-to-buy-and-sell-stock-ii/) 知识点:贪心算法 难度:简单 --- 2018年12月19日 [455. 分发饼干](https://github.com/hollischuang/algorithm/tree/master/leetcode/455-AssignCookies) [https://leetcode-cn.com/problems/assign-cookies/](https://leetcode-cn.com/problems/assign-cookies/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/assign-cookies/discuss/93987/Simple-Greedy-Java-Solution](https://leetcode.com/problems/assign-cookies/discuss/93987/Simple-Greedy-Java-Solution) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/assign-cookies/discuss/93997/Array-sort-%2B-Two-pointer-greedy-solution-O(nlogn)](https://leetcode.com/problems/assign-cookies/discuss/93997/Array-sort-%2B-Two-pointer-greedy-solution-O(nlogn)) 知识点:贪心算法 难度:简单 --- 2018年12月20日 [874. 模拟行走机器人](https://github.com/hollischuang/algorithm/tree/master/leetcode/874-walkingRobotSimulation) [https://leetcode-cn.com/problems/walking-robot-simulation/](https://leetcode-cn.com/problems/walking-robot-simulation/) 英文官方题解: [https://leetcode.com/problems/walking-robot-simulation/solution/](https://leetcode.com/problems/walking-robot-simulation/solution/) 知识点:贪心算法 难度:简单 --- 2018年12月21日 [102. 二叉树的层次遍历](https://github.com/hollischuang/algorithm/tree/master/leetcode/102-BinaryTreeLevelOrderTraversal) [https://leetcode-cn.com/problems/binary-tree-level-order-traversal/](https://leetcode-cn.com/problems/binary-tree-level-order-traversal/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/binary-tree-level-order-traversal/discuss/33450/Java-solution-with-a-queue-used](https://leetcode.com/problems/binary-tree-level-order-traversal/discuss/33450/Java-solution-with-a-queue-used) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/binary-tree-level-order-traversal/discuss/33445/Java-Solution-using-DFS](https://leetcode.com/problems/binary-tree-level-order-traversal/discuss/33445/Java-Solution-using-DFS) 知识点:广度优先搜索 难度:中等 --- 2018年12月22日 [104. 二叉树的最大深度](https://github.com/hollischuang/algorithm/tree/master/leetcode/104-MaximumDepthOfBinaryTree) [https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/](https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/) 官方题解: [https://leetcode-cn.com/articles/maximum-depth-of-binary-tree/](https://leetcode-cn.com/articles/maximum-depth-of-binary-tree/) 知识点:深度优先搜索 难度:简单 --- 2018年12月23日 [51. N-皇后](https://github.com/hollischuang/algorithm/tree/master/leetcode/051-NQueens) [https://leetcode-cn.com/problems/n-queens/](https://leetcode-cn.com/problems/n-queens/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/n-queens/discuss/19805/My-easy-understanding-Java-Solution](https://leetcode.com/problems/n-queens/discuss/19805/My-easy-understanding-Java-Solution) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/n-queens/discuss/19808/Accepted-4ms-c%2B%2B-solution-use-backtracking-and-bitmask-easy-understand.](https://leetcode.com/problems/n-queens/discuss/19808/Accepted-4ms-c%2B%2B-solution-use-backtracking-and-bitmask-easy-understand.) 知识点:剪枝 难度:困难 --- 2018年12月24日 [36. 有效的数独](https://github.com/hollischuang/algorithm/tree/master/leetcode/036-ValidSudoku) [https://leetcode-cn.com/problems/valid-sudoku/](https://leetcode-cn.com/problems/valid-sudoku/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/valid-sudoku/discuss/15472/Short%2BSimple-Java-using-Strings](https://leetcode.com/problems/valid-sudoku/discuss/15472/Short%2BSimple-Java-using-Strings) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/valid-sudoku/discuss/15450/Shared-my-concise-Java-code](https://leetcode.com/problems/valid-sudoku/discuss/15450/Shared-my-concise-Java-code) 知识点:剪枝 难度:中等 --- 2018年12月25日 [37. 解数独](https://github.com/hollischuang/algorithm/tree/master/leetcode/037-SudokuSolver) [https://leetcode-cn.com/problems/sudoku-solver/](https://leetcode-cn.com/problems/sudoku-solver/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/sudoku-solver/discuss/15752/Straight-Forward-Java-Solution-Using-Backtracking](https://leetcode.com/problems/sudoku-solver/discuss/15752/Straight-Forward-Java-Solution-Using-Backtracking) 知识点:剪枝 难度:困难 --- 2018年12月26日 [69. x 的平方根](https://github.com/hollischuang/algorithm/tree/master/leetcode/069-SqrtX) [https://leetcode-cn.com/problems/sqrtx/](https://leetcode-cn.com/problems/sqrtx/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/sqrtx/discuss/25047/A-Binary-Search-Solution](https://leetcode.com/problems/sqrtx/discuss/25047/A-Binary-Search-Solution) 知识点:二分查找 难度:简单 --- 2018年12月27日 [367. 有效的完全平方数](https://github.com/hollischuang/algorithm/tree/master/leetcode/367-ValidPerfectSquare) [https://leetcode-cn.com/problems/valid-perfect-square/](https://leetcode-cn.com/problems/valid-perfect-square/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/valid-perfect-square/discuss/83874/A-square-number-is-1%2B3%2B5%2B7%2B...-JAVA-code](https://leetcode.com/problems/valid-perfect-square/discuss/83874/A-square-number-is-1%2B3%2B5%2B7%2B...-JAVA-code) 知识点:二分查找 难度:简单 --- 2018年12月28日 [208. 实现 Trie (前缀树)](https://github.com/hollischuang/algorithm/tree/master/leetcode/208-implementTriePrefixTree) [https://leetcode-cn.com/problems/implement-trie-prefix-tree/](https://leetcode-cn.com/problems/implement-trie-prefix-tree/) 英文官方题解: [https://leetcode.com/articles/implement-trie-prefix-tree/](https://leetcode.com/articles/implement-trie-prefix-tree/) 知识点:字典树 难度:中等 --- 2018年12月29日 [212. 单词搜索 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/212-wordSearchII) [https://leetcode-cn.com/problems/word-search-ii/](https://leetcode-cn.com/problems/word-search-ii/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/word-search-ii/discuss/59780/Java-15ms-Easiest-Solution-(100.00)](https://leetcode.com/problems/word-search-ii/discuss/59780/Java-15ms-Easiest-Solution-(100.00)) 知识点:字典树 难度:困难 --- 2018年12月30日 [191. 位1的个数](https://github.com/hollischuang/algorithm/tree/master/leetcode/191-NumberOf1Bits) [https://leetcode-cn.com/problems/number-of-1-bits/](https://leetcode-cn.com/problems/number-of-1-bits/) 英文官方题解: [https://leetcode.com/articles/number-1-bits/](https://leetcode.com/articles/number-1-bits/) 知识点:位运算 难度:简单 --- 2018年12月31日 [338. 比特位计数](https://github.com/hollischuang/algorithm/tree/master/leetcode/338-CountingBits) [https://leetcode-cn.com/problems/counting-bits/](https://leetcode-cn.com/problems/counting-bits/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/counting-bits/discuss/79539/Three-Line-Java-Solution](https://leetcode.com/problems/counting-bits/discuss/79539/Three-Line-Java-Solution) 知识点:位运算 难度:中等 --- 2019年01月01日 [231. 2的幂](https://github.com/hollischuang/algorithm/tree/master/leetcode/231-PowerOfTwo) [https://leetcode-cn.com/problems/power-of-two/](https://leetcode-cn.com/problems/power-of-two/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/power-of-two/discuss/63972/One-line-java-solution-using-bitCount](https://leetcode.com/problems/power-of-two/discuss/63972/One-line-java-solution-using-bitCount) 知识点:位运算 难度:简单 --- 2019年01月02日 [52. N皇后 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/052-N-QueensII) [https://leetcode-cn.com/problems/n-queens-ii/](https://leetcode-cn.com/problems/n-queens-ii/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/n-queens-ii/discuss/20058/Accepted-Java-Solution](https://leetcode.com/problems/n-queens-ii/discuss/20058/Accepted-Java-Solution) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/n-queens-ii/discuss/20048/Easiest-Java-Solution-(1ms-98.22)](https://leetcode.com/problems/n-queens-ii/discuss/20048/Easiest-Java-Solution-(1ms-98.22)) 知识点:位运算 难度:困难 --- 2019年01月03日 [70. 爬楼梯](https://github.com/hollischuang/algorithm/tree/master/leetcode/070-ClimbingStairs) [https://leetcode-cn.com/problems/climbing-stairs/](https://leetcode-cn.com/problems/climbing-stairs/) 英文官方题解: [https://leetcode.com/articles/climbing-stairs/](https://leetcode.com/articles/climbing-stairs/) 知识点:动态规划 难度:简单 --- 2019年01月04日 [120. 三角形最小路径和](https://github.com/hollischuang/algorithm/tree/master/leetcode/120-Triangle) [https://leetcode-cn.com/problems/triangle/](https://leetcode-cn.com/problems/triangle/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/triangle/discuss/38730/DP-Solution-for-Triangle](https://leetcode.com/problems/triangle/discuss/38730/DP-Solution-for-Triangle) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/triangle/discuss/38724/7-lines-neat-Java-Solution](https://leetcode.com/problems/triangle/discuss/38724/7-lines-neat-Java-Solution) 知识点:动态规划 难度:中等 --- 2019年01月05日 [152. 乘积最大子序列](https://github.com/hollischuang/algorithm/tree/master/leetcode/152-MaximumProductSubarray) [https://leetcode-cn.com/problems/maximum-product-subarray/](https://leetcode-cn.com/problems/maximum-product-subarray/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/maximum-product-subarray/discuss/48230/Possibly-simplest-solution-with-O(n)-time-complexity](https://leetcode.com/problems/maximum-product-subarray/discuss/48230/Possibly-simplest-solution-with-O(n)-time-complexity) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/maximum-product-subarray/discuss/48252/Sharing-my-solution%3A-O(1)-space-O(n)-running-time](https://leetcode.com/problems/maximum-product-subarray/discuss/48252/Sharing-my-solution%3A-O(1)-space-O(n)-running-time) 知识点:动态规划 难度:中等 --- 2019年01月06日 [123. 买卖股票的最佳时机 III](https://github.com/hollischuang/algorithm/tree/master/leetcode/123-BestTimeToBuyAndSellStockIII) [https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/discuss/39611/Is-it-Best-Solution-with-O(n)-O(1).](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/discuss/39611/Is-it-Best-Solution-with-O(n)-O(1).) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/discuss/135704/Detail-explanation-of-DP-solution](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/discuss/135704/Detail-explanation-of-DP-solution) 知识点:动态规划 难度:困难 --- 2019年01月07日 [121. 买卖股票的最佳时机](https://github.com/hollischuang/algorithm/tree/master/leetcode/121-bestTimeToBuyAndSellStock) [https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/) 官方题解: [https://leetcode-cn.com/articles/best-time-to-buy-and-sell-stock/](https://leetcode-cn.com/articles/best-time-to-buy-and-sell-stock/) 知识点:动态规划 难度:简单 --- 2019年01月08日 [188. 买卖股票的最佳时机 IV](https://github.com/hollischuang/algorithm/tree/master/leetcode/188-bestTimeToBuyAndSellStockIV) [https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/discuss/54113/A-Concise-DP-Solution-in-Java](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/discuss/54113/A-Concise-DP-Solution-in-Java) 知识点:动态规划 难度:困难 --- 2019年01月09日 [309. 最佳买卖股票时机含冷冻期](https://github.com/hollischuang/algorithm/tree/master/leetcode/309-BestTimeToBuyAndSellStockWithCooldown) [https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/discuss/75927/Share-my-thinking-process](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/discuss/75927/Share-my-thinking-process) 知识点:动态规划 难度:中等 --- 2019年01月10日 [714. 买卖股票的最佳时机含手续费](https://github.com/hollischuang/algorithm/tree/master/leetcode/714-BestTimeToBuyAndSellStockWithTransactionFee) [https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/) 英文官方题解: [https://leetcode.com/articles/best-time-to-buy-and-sell-stock-with-transaction-fee/](https://leetcode.com/articles/best-time-to-buy-and-sell-stock-with-transaction-fee/) 知识点:动态规划 难度:中等 --- 2019年01月11日 [300. 最长上升子序列](https://github.com/hollischuang/algorithm/tree/master/leetcode/300-LongestIncreasingSubsequence) [https://leetcode-cn.com/problems/longest-increasing-subsequence/](https://leetcode-cn.com/problems/longest-increasing-subsequence/) 英文官方题解: [https://leetcode.com/articles/longest-increasing-subsequence/](https://leetcode.com/articles/longest-increasing-subsequence/) 知识点:动态规划 难度:中等 --- 2019年01月12日 [322. 零钱兑换](https://github.com/hollischuang/algorithm/tree/master/leetcode/322-CoinChange) [https://leetcode-cn.com/problems/coin-change/](https://leetcode-cn.com/problems/coin-change/) 英文官方题解: [https://leetcode.com/articles/coin-change/](https://leetcode.com/articles/coin-change/) 知识点:动态规划 难度:中等 --- 2019年01月13日 [72. 编辑距离](https://github.com/hollischuang/algorithm/tree/master/leetcode/072-EditDistance) [https://leetcode-cn.com/problems/edit-distance/](https://leetcode-cn.com/problems/edit-distance/) 英文官方题解: [https://leetcode.com/articles/edit-distance/](https://leetcode.com/articles/edit-distance/) 知识点:动态规划 难度:困难 --- 2019年01月14日 [200. 岛屿的个数](https://github.com/hollischuang/algorithm/tree/master/leetcode/200-numberOfIslands) [https://leetcode-cn.com/problems/number-of-islands/](https://leetcode-cn.com/problems/number-of-islands/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/number-of-islands/discuss/56359/Very-concise-Java-AC-solution](https://leetcode.com/problems/number-of-islands/discuss/56359/Very-concise-Java-AC-solution) 知识点:并查集 难度:中等 --- 2019年01月15日 [547. 朋友圈](https://github.com/hollischuang/algorithm/tree/master/leetcode/547-friendCircles) [https://leetcode-cn.com/problems/friend-circles/](https://leetcode-cn.com/problems/friend-circles/) 无官方题解,网友高票Java解法1(DFS): [https://leetcode.com/problems/friend-circles/discuss/101338/Neat-DFS-java-solution](https://leetcode.com/problems/friend-circles/discuss/101338/Neat-DFS-java-solution) 无官方题解,网友高票Java解法2(Union Find): [https://leetcode.com/problems/friend-circles/discuss/101336/Java-solution-Union-Find](https://leetcode.com/problems/friend-circles/discuss/101336/Java-solution-Union-Find) 知识点:并查集 难度:中等 --- 2019年01月16日 [146. LRU缓存机制](https://github.com/hollischuang/algorithm/tree/master/leetcode/146-lruCache) [https://leetcode-cn.com/problems/lru-cache/](https://leetcode-cn.com/problems/lru-cache/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/lru-cache/discuss/45911/Java-Hashtable-%2B-Double-linked-list-(with-a-touch-of-pseudo-nodes)](https://leetcode.com/problems/lru-cache/discuss/45911/Java-Hashtable-%2B-Double-linked-list-(with-a-touch-of-pseudo-nodes)) 知识点:LRU 难度:困难 --- 专题(End):《算法面试40讲》 ---
专题(Begin):动态规划 --- 2019年01月17日 [303. 区域和检索 - 数组不可变](https://github.com/hollischuang/algorithm/tree/master/leetcode/303-rangeSumQueryImmutable) [https://leetcode-cn.com/problems/range-sum-query-immutable/](https://leetcode-cn.com/problems/range-sum-query-immutable/) 英文官方题解: [https://leetcode.com/articles/range-sum-query-immutable/](https://leetcode.com/articles/range-sum-query-immutable/) 知识点:动态规划 难度:简单 --- 2019年01月18日 [746. 使用最小花费爬楼梯](https://github.com/hollischuang/algorithm/tree/master/leetcode/746-minCostClimbingStairs) [https://leetcode-cn.com/problems/min-cost-climbing-stairs/](https://leetcode-cn.com/problems/min-cost-climbing-stairs/) 英文官方题解: [https://leetcode.com/articles/min-cost-climbing-stairs/](https://leetcode.com/articles/min-cost-climbing-stairs/) 知识点:动态规划 难度:简单 --- 2019年01月19日 [198. 打家劫舍](https://github.com/hollischuang/algorithm/tree/master/leetcode/198-houseRobber) [https://leetcode-cn.com/problems/house-robber/](https://leetcode-cn.com/problems/house-robber/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/house-robber/discuss/156523/From-good-to-great.-How-to-approach-most-of-DP-problems.](https://leetcode.com/problems/house-robber/discuss/156523/From-good-to-great.-How-to-approach-most-of-DP-problems.) 知识点:动态规划 难度:简单 --- 2019年01月20日 [877. 石子游戏](https://github.com/hollischuang/algorithm/tree/master/leetcode/877-stoneGame) [https://leetcode-cn.com/problems/stone-game/](https://leetcode-cn.com/problems/stone-game/) 官方题解: [https://leetcode-cn.com/articles/stone-game/](https://leetcode-cn.com/articles/stone-game/) 知识点:动态规划 难度:中等 --- 2019年01月21日 [64. 最小路径和](https://github.com/hollischuang/algorithm/tree/master/leetcode/064-minimumPathSum) [https://leetcode-cn.com/problems/minimum-path-sum/](https://leetcode-cn.com/problems/minimum-path-sum/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/minimum-path-sum/discuss/23471/My-java-solution-using-DP-and-no-extra-space](https://leetcode.com/problems/minimum-path-sum/discuss/23471/My-java-solution-using-DP-and-no-extra-space) 知识点:动态规划 难度:中等 --- 2019年01月22日 [96. 不同的二叉搜索树](https://github.com/hollischuang/algorithm/tree/master/leetcode/096-uniqueBinarySearchTrees) [https://leetcode-cn.com/problems/unique-binary-search-trees/](https://leetcode-cn.com/problems/unique-binary-search-trees/) 英文官方题解: [https://leetcode.com/articles/unique-binary-search-trees/](https://leetcode.com/articles/unique-binary-search-trees/) 知识点:动态规划 难度:中等 --- 2019年01月23日 [413. 等差数列划分](https://github.com/hollischuang/algorithm/tree/master/leetcode/413-arithmeticSlices) [https://leetcode-cn.com/problems/arithmetic-slices/](https://leetcode-cn.com/problems/arithmetic-slices/) 英文官方题解: [https://leetcode.com/articles/arithmetic-slices/](https://leetcode.com/articles/arithmetic-slices/) 知识点:动态规划 难度:中等 --- 2019年01月24日 [712. 两个字符串的最小ASCII删除和](https://github.com/hollischuang/algorithm/tree/master/leetcode/712-MinimumASCIIDeleteSumforTwoStrings) [https://leetcode-cn.com/problems/minimum-ascii-delete-sum-for-two-strings/](https://leetcode-cn.com/problems/minimum-ascii-delete-sum-for-two-strings/) 英文官方题解: [https://leetcode.com/articles/minimum-ascii-delete-sum-for-two-strings/](https://leetcode.com/articles/minimum-ascii-delete-sum-for-two-strings/) 知识点:动态规划 难度:中等 --- 2019年01月25日 [62. 不同路径](https://github.com/hollischuang/algorithm/tree/master/leetcode/062-UniquePaths) [https://leetcode-cn.com/problems/unique-paths/](https://leetcode-cn.com/problems/unique-paths/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/unique-paths/discuss/22958/Math-solution-O(1)-space](https://leetcode.com/problems/unique-paths/discuss/22958/Math-solution-O(1)-space) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/unique-paths/discuss/22953/Java-DP-solution-with-complexity-O(n*m)](https://leetcode.com/problems/unique-paths/discuss/22953/Java-DP-solution-with-complexity-O(n*m)) 知识点:动态规划 难度:中等 --- 2019年01月26日 [638. 大礼包](https://github.com/hollischuang/algorithm/tree/master/leetcode/638-ShoppingOffers) [https://leetcode-cn.com/problems/shopping-offers/](https://leetcode-cn.com/problems/shopping-offers/) 英文官方题解: [https://leetcode.com/articles/shopping-offers/](https://leetcode.com/articles/shopping-offers/) 知识点:动态规划 难度:中等 --- 2019年01月27日 [647. 回文子串](https://github.com/hollischuang/algorithm/tree/master/leetcode/647-PalindromicSubstrings) [https://leetcode-cn.com/problems/palindromic-substrings/](https://leetcode-cn.com/problems/palindromic-substrings/) 英文官方题解: [https://leetcode.com/articles/palindromic-substrings/](https://leetcode.com/articles/palindromic-substrings/) 知识点:动态规划 难度:中等 --- 2019年01月28日 [931. 下降路径最小和](https://github.com/hollischuang/algorithm/tree/master/leetcode/931-MinimumFallingPathSum) [https://leetcode-cn.com/problems/minimum-falling-path-sum/](https://leetcode-cn.com/problems/minimum-falling-path-sum/) 英文官方题解: [https://leetcode.com/articles/minimum-path-falling-sum/](https://leetcode.com/articles/minimum-path-falling-sum/) 知识点:动态规划 难度:中等 --- 2019年01月29日 [343. 整数拆分](https://github.com/hollischuang/algorithm/tree/master/leetcode/343-IntegerBreak) [https://leetcode-cn.com/problems/integer-break/](https://leetcode-cn.com/problems/integer-break/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/integer-break/discuss/80689/A-simple-explanation-of-the-math-part-and-a-O(n)-solution](https://leetcode.com/problems/integer-break/discuss/80689/A-simple-explanation-of-the-math-part-and-a-O(n)-solution) 知识点:动态规划 难度:中等 --- 2019年01月30日 [95. 不同的二叉搜索树 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/095-UniqueBinarySearchTreesII) [https://leetcode-cn.com/problems/unique-binary-search-trees-ii/](https://leetcode-cn.com/problems/unique-binary-search-trees-ii/) 英文官方题解: [https://leetcode.com/articles/unique-binary-search-trees-ii/](https://leetcode.com/articles/unique-binary-search-trees-ii/) 知识点:动态规划 难度:中等 --- 2019年01月31日 [740. 删除与获得点数](https://github.com/hollischuang/algorithm/tree/master/leetcode/740-DeleteAndEarn) [https://leetcode-cn.com/problems/delete-and-earn/](https://leetcode-cn.com/problems/delete-and-earn/) 英文官方题解: [https://leetcode.com/articles/delete-and-earn/](https://leetcode.com/articles/delete-and-earn/) 知识点:动态规划 难度:中等 --- 2019年02月01日 [646. 最长数对链](https://github.com/hollischuang/algorithm/tree/master/leetcode/646-MaximumLengthOfPairChain) [https://leetcode-cn.com/problems/maximum-length-of-pair-chain/](https://leetcode-cn.com/problems/maximum-length-of-pair-chain/) 英文官方题解: [https://leetcode.com/articles/maximum-length-of-pair-chain/](https://leetcode.com/articles/maximum-length-of-pair-chain/) 知识点:动态规划 难度:中等 --- 2019年02月02日 [764. 最大加号标志](https://github.com/hollischuang/algorithm/tree/master/leetcode/764-LargestPlusSign) [https://leetcode-cn.com/problems/largest-plus-sign/](https://leetcode-cn.com/problems/largest-plus-sign/) 英文官方题解: [https://leetcode.com/articles/largest-plus-sign/](https://leetcode.com/articles/largest-plus-sign/) 知识点:动态规划 难度:中等 --- 2019年02月03日 [279. 完全平方数](https://github.com/hollischuang/algorithm/tree/master/leetcode/279-PerfectSquares) [https://leetcode-cn.com/problems/perfect-squares/](https://leetcode-cn.com/problems/perfect-squares/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/perfect-squares/discuss/71495/An-easy-understanding-DP-solution-in-Java](https://leetcode.com/problems/perfect-squares/discuss/71495/An-easy-understanding-DP-solution-in-Java) 知识点:动态规划 难度:中等 --- 2019年02月04日 [392. 判断子序列](https://github.com/hollischuang/algorithm/tree/master/leetcode/392-IsSubsequence) [https://leetcode-cn.com/problems/is-subsequence/](https://leetcode-cn.com/problems/is-subsequence/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/is-subsequence/discuss/87302/Binary-search-solution-for-follow-up-with-detailed-comments](https://leetcode.com/problems/is-subsequence/discuss/87302/Binary-search-solution-for-follow-up-with-detailed-comments) 知识点:动态规划 难度:中等 --- 2019年02月05日 [377. 组合总和 Ⅳ](https://github.com/hollischuang/algorithm/tree/master/leetcode/377-CombinationSumIV) [https://leetcode-cn.com/problems/combination-sum-iv/](https://leetcode-cn.com/problems/combination-sum-iv/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/combination-sum-iv/discuss/85036/1ms-Java-DP-Solution-with-Detailed-Explanation](https://leetcode.com/problems/combination-sum-iv/discuss/85036/1ms-Java-DP-Solution-with-Detailed-Explanation) 知识点:动态规划 难度:中等 --- 2019年02月06日 [486. 预测赢家](https://github.com/hollischuang/algorithm/tree/master/leetcode/486-PredictTheWinner) [https://leetcode-cn.com/problems/predict-the-winner/](https://leetcode-cn.com/problems/predict-the-winner/) 英文官方题解: [https://leetcode.com/articles/predict-the-winner/](https://leetcode.com/articles/predict-the-winner/) 知识点:动态规划 难度:中等 --- 2019年02月07日 [357. 计算各个位数不同的数字个数](https://github.com/hollischuang/algorithm/tree/master/leetcode/357-CountNumbersWithUniqueDigits) [https://leetcode-cn.com/problems/count-numbers-with-unique-digits/](https://leetcode-cn.com/problems/count-numbers-with-unique-digits/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/count-numbers-with-unique-digits/discuss/83041/JAVA-DP-O(1)-solution.](https://leetcode.com/problems/count-numbers-with-unique-digits/discuss/83041/JAVA-DP-O(1)-solution.) 知识点:动态规划 难度:中等 --- 2019年02月08日 [494. 目标和](https://github.com/hollischuang/algorithm/tree/master/leetcode/494-TargetSum) [https://leetcode-cn.com/problems/target-sum/](https://leetcode-cn.com/problems/target-sum/) 英文官方题解: [https://leetcode.com/articles/target-sum/](https://leetcode.com/articles/target-sum/) 知识点:动态规划 难度:中等 --- 2019年02月09日 [516. 最长回文子序列](https://github.com/hollischuang/algorithm/tree/master/leetcode/516-LongestPalindromicSubsequence) [https://leetcode-cn.com/problems/longest-palindromic-subsequence/](https://leetcode-cn.com/problems/longest-palindromic-subsequence/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/longest-palindromic-subsequence/discuss/99101/Straight-forward-Java-DP-solution](https://leetcode.com/problems/longest-palindromic-subsequence/discuss/99101/Straight-forward-Java-DP-solution) 知识点:动态规划 难度:中等 --- 2019年02月10日 [688. “马”在棋盘上的概率](https://github.com/hollischuang/algorithm/tree/master/leetcode/688-KnightProbabilityInChessboard) [https://leetcode-cn.com/problems/knight-probability-in-chessboard/](https://leetcode-cn.com/problems/knight-probability-in-chessboard/) 英文官方题解: [https://leetcode.com/articles/knight-probability-in-chessboard/](https://leetcode.com/articles/knight-probability-in-chessboard/) 知识点:动态规划 难度:中等 --- 2019年02月11日 [718. 最长重复子数组](https://github.com/hollischuang/algorithm/tree/master/leetcode/718-MaximumLengthOfRepeatedSubarray) [https://leetcode-cn.com/problems/maximum-length-of-repeated-subarray/](https://leetcode-cn.com/problems/maximum-length-of-repeated-subarray/) 英文官方题解: [https://leetcode.com/articles/maximum-length-of-repeated-subarray/](https://leetcode.com/articles/maximum-length-of-repeated-subarray/) 知识点:动态规划 难度:中等 --- 2019年02月12日 [650. 只有两个键的键盘](https://github.com/hollischuang/algorithm/tree/master/leetcode/650-2KeysKeyboard) [https://leetcode-cn.com/problems/2-keys-keyboard/](https://leetcode-cn.com/problems/2-keys-keyboard/) 英文官方题解: [https://leetcode.com/articles/2-keys-keyboard/](https://leetcode.com/articles/2-keys-keyboard/) 知识点:动态规划 难度:中等 --- 2019年02月13日 [873. 最长的斐波那契子序列的长度](https://github.com/hollischuang/algorithm/tree/master/leetcode/873-LengthOfLongestFibonacciSubsequence) [https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence/](https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence/) 官方题解: [https://leetcode-cn.com/articles/length-of-longest-fibonacci-subsequence/](https://leetcode-cn.com/articles/length-of-longest-fibonacci-subsequence/) 知识点:动态规划 难度:中等 --- 2019年02月14日 [139. 单词拆分](https://github.com/hollischuang/algorithm/tree/master/leetcode/139-WordBreak) [https://leetcode-cn.com/problems/word-break/](https://leetcode-cn.com/problems/word-break/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/word-break/discuss/43790/Java-implementation-using-DP-in-two-ways](https://leetcode.com/problems/word-break/discuss/43790/Java-implementation-using-DP-in-two-ways) 知识点:动态规划 难度:中等 --- 2019年02月15日 [264. 丑数 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/264-UglyNumberII) [https://leetcode-cn.com/problems/ugly-number-ii/](https://leetcode-cn.com/problems/ugly-number-ii/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/ugly-number-ii/discuss/69362/O(n)-Java-solution](https://leetcode.com/problems/ugly-number-ii/discuss/69362/O(n)-Java-solution) 知识点:动态规划 难度:中等 --- 2019年02月16日 [416. 分割等和子集](https://github.com/hollischuang/algorithm/tree/master/leetcode/416-PartitionEqualSubsetSum) [https://leetcode-cn.com/problems/partition-equal-subset-sum/](https://leetcode-cn.com/problems/partition-equal-subset-sum/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation](https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/partition-equal-subset-sum/discuss/90627/Java-Solution-similar-to-backpack-problem-Easy-to-understand](https://leetcode.com/problems/partition-equal-subset-sum/discuss/90627/Java-Solution-similar-to-backpack-problem-Easy-to-understand) 知识点:动态规划 难度:中等 --- 2019年02月17日 [304. 二维区域和检索 - 矩阵不可变](https://github.com/hollischuang/algorithm/tree/master/leetcode/304-RangeSumQuery2DImmutable) [https://leetcode-cn.com/problems/range-sum-query-2d-immutable/](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/) 英文无官方题解: [https://leetcode.com/articles/range-sum-query-2d-immutable/](https://leetcode.com/articles/range-sum-query-2d-immutable/) 知识点:动态规划 难度:中等 --- 2019年02月18日 [221. 最大正方形](https://github.com/hollischuang/algorithm/tree/master/leetcode/221-MaximalSquare) [https://leetcode-cn.com/problems/maximal-square/](https://leetcode-cn.com/problems/maximal-square/) 英文官方题解: [https://leetcode.com/articles/maximal-square/](https://leetcode.com/articles/maximal-square/) 知识点:动态规划 难度:中等 --- 2019年02月19日 [698. 划分为k个相等的子集](https://github.com/hollischuang/algorithm/tree/master/leetcode/698-PartitionToKEqualSumSubsets) [https://leetcode-cn.com/problems/partition-to-k-equal-sum-subsets/](https://leetcode-cn.com/problems/partition-to-k-equal-sum-subsets/) 英文官方题解: [https://leetcode.com/articles/partition-to-k-equal-sum-subsets/](https://leetcode.com/articles/partition-to-k-equal-sum-subsets/) 知识点:动态规划 难度:中等 --- 2019年02月20日 [474. 一和零](https://github.com/hollischuang/algorithm/tree/master/leetcode/474-OnesAndZeroes) [https://leetcode-cn.com/problems/ones-and-zeroes/](https://leetcode-cn.com/problems/ones-and-zeroes/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/ones-and-zeroes/discuss/95807/0-1-knapsack-detailed-explanation.](https://leetcode.com/problems/ones-and-zeroes/discuss/95807/0-1-knapsack-detailed-explanation.) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/ones-and-zeroes/discuss/95811/Java-Iterative-DP-Solution-O(mn)-Space](https://leetcode.com/problems/ones-and-zeroes/discuss/95811/Java-Iterative-DP-Solution-O(mn)-Space) 知识点:动态规划 难度:中等 --- 2019年02月21日 [838. 推多米诺](https://github.com/hollischuang/algorithm/tree/master/leetcode/838-PushDominoes) [https://leetcode-cn.com/problems/push-dominoes/](https://leetcode-cn.com/problems/push-dominoes/) 无官方题解,网友高票Java解法: [https://leetcode.com/articles/push-dominoes/](https://leetcode.com/articles/push-dominoes/) 知识点:动态规划 难度:中等 --- 2019年02月22日 [790. 多米诺和托米诺平铺](https://github.com/hollischuang/algorithm/tree/master/leetcode/790-DominoAndTrominoTiling) [https://leetcode-cn.com/problems/domino-and-tromino-tiling/](https://leetcode-cn.com/problems/domino-and-tromino-tiling/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/domino-and-tromino-tiling/discuss/116581/Detail-and-explanation-of-O(n)-solution-why-dpn2*dn-1%2Bdpn-3](https://leetcode.com/problems/domino-and-tromino-tiling/discuss/116581/Detail-and-explanation-of-O(n)-solution-why-dpn2*dn-1%2Bdpn-3) 知识点:动态规划 难度:中等 --- 2019年02月23日 [813. 最大平均值和的分组](https://github.com/hollischuang/algorithm/tree/master/leetcode/813-LargestSumOfAverages) [https://leetcode-cn.com/problems/largest-sum-of-averages/](https://leetcode-cn.com/problems/largest-sum-of-averages/) 英文官方题解: [https://leetcode.com/articles/largest-sum-of-averages/](https://leetcode.com/articles/largest-sum-of-averages/) 知识点:动态规划 难度:中等 --- 2019年02月24日 [376. 摆动序列变](https://github.com/hollischuang/algorithm/tree/master/leetcode/367-ValidPerfectSquare) [https://leetcode-cn.com/problems/wiggle-subsequence/](https://leetcode-cn.com/problems/wiggle-subsequence/) 英文官方题解: [https://leetcode.com/articles/wiggle-subsequence/](https://leetcode.com/articles/wiggle-subsequence/) 知识点:动态规划 难度:中等 --- 2019年02月25日 [801. 使序列递增的最小交换次数](https://github.com/hollischuang/algorithm/tree/master/leetcode/801-MinimumSwapsToMakeSequencesIncreasing) [https://leetcode-cn.com/problems/minimum-swaps-to-make-sequences-increasing/](https://leetcode-cn.com/problems/minimum-swaps-to-make-sequences-increasing/) 英文官方题解: [https://leetcode.com/articles/minimum-swaps-to-make-sequences-increasing/](https://leetcode.com/articles/minimum-swaps-to-make-sequences-increasing/) 知识点:动态规划 难度:中等 --- 2019年02月26日 [808. 分汤](https://github.com/hollischuang/algorithm/tree/master/leetcode/808-SoupServings) [https://leetcode-cn.com/problems/soup-servings/](https://leetcode-cn.com/problems/soup-servings/) 英文官方题解: [https://leetcode.com/articles/soup-servings/](https://leetcode.com/articles/soup-servings/) 知识点:动态规划 难度:中等 --- 2019年02月27日 [63. 不同路径 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/063-UniquePathsII) [https://leetcode-cn.com/problems/unique-paths-ii/](https://leetcode-cn.com/problems/unique-paths-ii/) 英文官方题解: [https://leetcode.com/articles/unique-paths-ii/](https://leetcode.com/articles/unique-paths-ii/) 知识点:动态规划 难度:中等 --- 2019年02月28日 [213. 打家劫舍 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/213-HouseRobberII) [https://leetcode-cn.com/problems/house-robber-ii/](https://leetcode-cn.com/problems/house-robber-ii/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/house-robber-ii/discuss/59934/Simple-AC-solution-in-Java-in-O(n)-with-explanation](https://leetcode.com/problems/house-robber-ii/discuss/59934/Simple-AC-solution-in-Java-in-O(n)-with-explanation) 知识点:动态规划 难度:中等 --- 2019年03月01日 [368. 最大整除子集](https://github.com/hollischuang/algorithm/tree/master/leetcode/368-LargestDivisibleSubset) [https://leetcode-cn.com/problems/largest-divisible-subset/](https://leetcode-cn.com/problems/largest-divisible-subset/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/largest-divisible-subset/discuss/84006/Classic-DP-solution-similar-to-LIS-O(n2)](https://leetcode.com/problems/largest-divisible-subset/discuss/84006/Classic-DP-solution-similar-to-LIS-O(n2)) 知识点:动态规划 难度:中等 --- 2019年03月02日 [467. 环绕字符串中唯一的子字符串](https://github.com/hollischuang/algorithm/tree/master/leetcode/467-UniqueSubstringsInWraparoundString) [https://leetcode-cn.com/problems/unique-substrings-in-wraparound-string/](https://leetcode-cn.com/problems/unique-substrings-in-wraparound-string/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/unique-substrings-in-wraparound-string/discuss/95439/Concise-Java-solution-using-DP](https://leetcode.com/problems/unique-substrings-in-wraparound-string/discuss/95439/Concise-Java-solution-using-DP) 知识点:动态规划 难度:中等 --- 2019年03月03日 [464. 我能赢吗](https://github.com/hollischuang/algorithm/tree/master/leetcode/464-CanIWin) [https://leetcode-cn.com/problems/can-i-win/](https://leetcode-cn.com/problems/can-i-win/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/can-i-win/discuss/95277/Java-solution-using-HashMap-with-detailed-explanation](https://leetcode.com/problems/can-i-win/discuss/95277/Java-solution-using-HashMap-with-detailed-explanation) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/can-i-win/discuss/95293/Java-easy-strightforward-solution-with-explanation](https://leetcode.com/problems/can-i-win/discuss/95293/Java-easy-strightforward-solution-with-explanation) 知识点:动态规划 难度:中等 --- 2019年03月04日 [935. 骑士拨号器](https://github.com/hollischuang/algorithm/tree/master/leetcode/935-KnightDialer) [https://leetcode-cn.com/problems/knight-dialer/](https://leetcode-cn.com/problems/knight-dialer/) 英文官方题解: [https://leetcode.com/articles/knight-dialer/](https://leetcode.com/articles/knight-dialer/) 知识点:动态规划 难度:中等 --- 2019年03月05日 [787. K 站中转内最便宜的航班](https://github.com/hollischuang/algorithm/tree/master/leetcode/787-CheapestFlightsWithinKStops) [https://leetcode-cn.com/problems/cheapest-flights-within-k-stops/](https://leetcode-cn.com/problems/cheapest-flights-within-k-stops/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/cheapest-flights-within-k-stops/discuss/115541/JavaPython-Priority-Queue-Solution](https://leetcode.com/problems/cheapest-flights-within-k-stops/discuss/115541/JavaPython-Priority-Queue-Solution) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/cheapest-flights-within-k-stops/discuss/128776/5-ms-AC-Java-Solution-based-on-Dijkstra's-Algorithm](https://leetcode.com/problems/cheapest-flights-within-k-stops/discuss/128776/5-ms-AC-Java-Solution-based-on-Dijkstra's-Algorithm) 知识点:动态规划 难度:中等 --- 2019年03月06日 [576. 出界的路径数](https://github.com/hollischuang/algorithm/tree/master/leetcode/576-OutOfBoundaryPaths) [https://leetcode-cn.com/problems/out-of-boundary-paths/](https://leetcode-cn.com/problems/out-of-boundary-paths/) 英文官方题解: [https://leetcode.com/articles/out-of-boundary-paths/](https://leetcode.com/articles/out-of-boundary-paths/) 知识点:动态规划 难度:中等 --- 2019年03月07日 [374. 猜数字大小](https://github.com/hollischuang/algorithm/tree/master/leetcode/374-GuessNumberHigherOrLower) [https://leetcode-cn.com/problems/guess-number-higher-or-lower/](https://leetcode-cn.com/problems/guess-number-higher-or-lower/) 英文官方题解: [https://leetcode.com/articles/guess-number-higher-or-lower/](https://leetcode.com/articles/guess-number-higher-or-lower/) 知识点:二分查找 难度:简单 --- 2019年03月08日 [375. 猜数字大小 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/375-GuessNumberHigherOrLowerII) [https://leetcode-cn.com/problems/guess-number-higher-or-lower-ii/](https://leetcode-cn.com/problems/guess-number-higher-or-lower-ii/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/guess-number-higher-or-lower-ii/discuss/84764/Simple-DP-solution-with-explanation~~](https://leetcode.com/problems/guess-number-higher-or-lower-ii/discuss/84764/Simple-DP-solution-with-explanation~~) 知识点:动态规划 难度:中等 --- 2019年03月09日 [967. 连续差相同的数字](https://github.com/hollischuang/algorithm/tree/master/leetcode/967-NumbersWithSameConsecutiveDifferences) [https://leetcode-cn.com/problems/numbers-with-same-consecutive-differences/](https://leetcode-cn.com/problems/numbers-with-same-consecutive-differences/) 英文官方题解: [https://leetcode.com/articles/numbers-with-same-consecutive-differences/](https://leetcode.com/articles/numbers-with-same-consecutive-differences/) 知识点:动态规划 难度:中等 --- 2019年03月10日 [673. 最长递增子序列的个数](https://github.com/hollischuang/algorithm/tree/master/leetcode/673-NumberOfLongestIncreasingSubsequence) [https://leetcode-cn.com/problems/number-of-longest-increasing-subsequence/](https://leetcode-cn.com/problems/number-of-longest-increasing-subsequence/) 英文官方题解: [https://leetcode.com/articles/number-of-longest-increasing-subsequence/](https://leetcode.com/articles/number-of-longest-increasing-subsequence/) 知识点:动态规划 难度:中等 --- 2019年03月11日 [131. 分割回文串](https://github.com/hollischuang/algorithm/tree/master/leetcode/131-PalindromePartitioning) [https://leetcode-cn.com/problems/palindrome-partitioning/](https://leetcode-cn.com/problems/palindrome-partitioning/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/palindrome-partitioning/discuss/41963/Java%3A-Backtracking-solution.](https://leetcode.com/problems/palindrome-partitioning/discuss/41963/Java%3A-Backtracking-solution.) 知识点:回溯算法 难度:中等 --- 2019年03月12日 [132. 分割回文串II](https://github.com/hollischuang/algorithm/tree/master/leetcode/132-PalindromePartitioningII) [https://leetcode-cn.com/problems/palindrome-partitioning-ii/](https://leetcode-cn.com/problems/palindrome-partitioning-ii/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/palindrome-partitioning-ii/discuss/42198/My-solution-does-not-need-a-table-for-palindrome-is-it-right-It-uses-only-O(n)-space.](https://leetcode.com/problems/palindrome-partitioning-ii/discuss/42198/My-solution-does-not-need-a-table-for-palindrome-is-it-right-It-uses-only-O(n)-space.) 知识点:动态规划 难度:困难 --- 2019年03月13日 [5. 最长回文子串](https://github.com/hollischuang/algorithm/tree/master/leetcode/005-LongestPalindromicSubstring) [https://leetcode-cn.com/problems/longest-palindromic-substring/](https://leetcode-cn.com/problems/longest-palindromic-substring/) 英文官方题解: [https://leetcode.com/articles/longest-palindromic-substring/](https://leetcode.com/articles/longest-palindromic-substring/) 知识点:动态规划 难度:中等 --- 2019年03月14日 [523. 连续的子数组和](https://github.com/hollischuang/algorithm/tree/master/leetcode/523-ContinuousSubarraySum) [https://leetcode-cn.com/problems/continuous-subarray-sum/](https://leetcode-cn.com/problems/continuous-subarray-sum/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/continuous-subarray-sum/discuss/99499/Java-O(n)-time-O(k)-space](https://leetcode.com/problems/continuous-subarray-sum/discuss/99499/Java-O(n)-time-O(k)-space) 知识点:动态规划 难度:中等 --- 2019年03月15日 [837. 新21点](https://github.com/hollischuang/algorithm/tree/master/leetcode/837-New21Game) [https://leetcode-cn.com/problems/new-21-game/](https://leetcode-cn.com/problems/new-21-game/) 英文官方题解: [https://leetcode.com/articles/new-21-game/](https://leetcode.com/articles/new-21-game/) 知识点:动态规划 难度:中等 --- 2019年03月16日 [898. 子数组按位或操作](https://github.com/hollischuang/algorithm/tree/master/leetcode/898-BitwiseORsOfSubarrays) [https://leetcode-cn.com/problems/bitwise-ors-of-subarrays/](https://leetcode-cn.com/problems/bitwise-ors-of-subarrays/) 英文官方题解: [https://leetcode.com/articles/bitwise-ors-of-subarrays/](https://leetcode.com/articles/bitwise-ors-of-subarrays/) 知识点:动态规划 难度:中等 --- 2019年03月17日 [91. 解码方法](https://github.com/hollischuang/algorithm/tree/master/leetcode/091-DecodeWays) [https://leetcode-cn.com/problems/decode-ways/](https://leetcode-cn.com/problems/decode-ways/) 无官方题解,网友高票Java解法1: [https://leetcode.com/problems/decode-ways/discuss/30357/DP-Solution-(Java)-for-reference](https://leetcode.com/problems/decode-ways/discuss/30357/DP-Solution-(Java)-for-reference) 无官方题解,网友高票Java解法2: [https://leetcode.com/problems/decode-ways/discuss/30358/Java-clean-DP-solution-with-explanation](https://leetcode.com/problems/decode-ways/discuss/30358/Java-clean-DP-solution-with-explanation) 知识点:动态规划 难度:中等 --- 2019年03月18日 [312. 戳气球](https://github.com/hollischuang/algorithm/tree/master/leetcode/312-BurstBalloons) [https://leetcode-cn.com/problems/burst-balloons/](https://leetcode-cn.com/problems/burst-balloons/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/burst-balloons/discuss/76228/Share-some-analysis-and-explanations](https://leetcode.com/problems/burst-balloons/discuss/76228/Share-some-analysis-and-explanations) 知识点:动态规划 难度:困难 --- 2019年03月19日 [72. 编辑距离](https://github.com/hollischuang/algorithm/tree/master/leetcode/072-EditDistance) [https://leetcode-cn.com/problems/edit-distance/](https://leetcode-cn.com/problems/edit-distance/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/edit-distance/discuss/25849/Java-DP-solution-O(nm)](https://leetcode.com/problems/edit-distance/discuss/25849/Java-DP-solution-O(nm)) 知识点:动态规划 难度:困难 --- 2019年03月20日 [975. 奇偶跳](https://github.com/hollischuang/algorithm/tree/master/leetcode/975-OddEvenJump) [https://leetcode-cn.com/problems/odd-even-jump/](https://leetcode-cn.com/problems/odd-even-jump/) 官方题解: [https://leetcode-cn.com/articles/odd-even-jump/](https://leetcode-cn.com/articles/odd-even-jump/) 知识点:动态规划 难度:困难 --- 2019年03月21日 [115. 不同的子序列](https://github.com/hollischuang/algorithm/tree/master/leetcode/115-DistinctSubsequences) [https://leetcode-cn.com/problems/distinct-subsequences/](https://leetcode-cn.com/problems/distinct-subsequences/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/distinct-subsequences/discuss/37327/Easy-to-understand-DP-in-Java](https://leetcode.com/problems/distinct-subsequences/discuss/37327/Easy-to-understand-DP-in-Java) 知识点:动态规划 难度:困难 --- 2019年03月22日 [940. 不同的子序列 II](https://github.com/hollischuang/algorithm/tree/master/leetcode/940-DistinctSubsequencesII) [https://leetcode-cn.com/problems/distinct-subsequences-ii/](https://leetcode-cn.com/problems/distinct-subsequences-ii/) 英文官方题解: [https://leetcode.com/articles/distinct-subsequences-ii/](https://leetcode.com/articles/distinct-subsequences-ii/) 知识点:动态规划 难度:困难 --- 2019年03月23日 [691. 贴纸拼词](https://github.com/hollischuang/algorithm/tree/master/leetcode/691-StickersToSpellWord) [https://leetcode-cn.com/problems/stickers-to-spell-word/](https://leetcode-cn.com/problems/stickers-to-spell-word/) 英文官方题解: [https://leetcode.com/articles/stickers-to-spell-word/](https://leetcode.com/articles/stickers-to-spell-word/) 知识点:动态规划 难度:困难 --- 2019年03月24日 [982. 按位与为零的三元组](https://github.com/hollischuang/algorithm/tree/master/leetcode/982-TriplesWithBitwiseANDEqualToZero) [https://leetcode-cn.com/problems/triples-with-bitwise-and-equal-to-zero/](https://leetcode-cn.com/problems/triples-with-bitwise-and-equal-to-zero/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/226721/Java-DP-O(3-*-216-*-n)-time-O(216)-space](https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/226721/Java-DP-O(3-*-216-*-n)-time-O(216)-space) 知识点:动态规划 难度:困难 --- 2019年03月25日 [546. 移除盒子](https://github.com/hollischuang/algorithm/tree/master/leetcode/546-RemoveBoxes) [https://leetcode-cn.com/problems/remove-boxes/](https://leetcode-cn.com/problems/remove-boxes/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/remove-boxes/discuss/101310/Java-top-down-and-bottom-up-DP-solutions](https://leetcode.com/problems/remove-boxes/discuss/101310/Java-top-down-and-bottom-up-DP-solutions) 知识点:动态规划 难度:困难 --- 2019年03月26日 [85. 最大矩形](https://github.com/hollischuang/algorithm/tree/master/leetcode/085-MaximalRectangle) [https://leetcode-cn.com/problems/maximal-rectangle/](https://leetcode-cn.com/problems/maximal-rectangle/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/maximal-rectangle/discuss/29054/Share-my-DP-solution](https://leetcode.com/problems/maximal-rectangle/discuss/29054/Share-my-DP-solution) 知识点:动态规划 难度:困难 --- 2019年03月27日 [903. DI 序列的有效排列](https://github.com/hollischuang/algorithm/tree/master/leetcode/903-ValidPermutationsForDISequence) [https://leetcode-cn.com/problems/valid-permutations-for-di-sequence/](https://leetcode-cn.com/problems/valid-permutations-for-di-sequence/) 英文官方题解: [https://leetcode.com/articles/valid-permutations-for-di-sequence/](https://leetcode.com/articles/valid-permutations-for-di-sequence/) 知识点:动态规划 难度:困难 --- 2019年03月28日 [629. K个逆序对数组](https://github.com/hollischuang/algorithm/tree/master/leetcode/629-KInversePairsArray) [https://leetcode-cn.com/problems/k-inverse-pairs-array/](https://leetcode-cn.com/problems/k-inverse-pairs-array/) 英文官方题解: [https://leetcode.com/articles/k-inverse-pairs-array/](https://leetcode.com/articles/k-inverse-pairs-array/) 知识点:动态规划 难度:困难 --- 2019年03月29日 [956. 最高的广告牌](https://github.com/hollischuang/algorithm/tree/master/leetcode/629-KInversePairsArray) [https://leetcode-cn.com/problems/tallest-billboard/](https://leetcode-cn.com/problems/tallest-billboard/) 英文官方题解: [https://leetcode.com/problems/tallest-billboard/solution/](https://leetcode.com/problems/tallest-billboard/solution/) 知识点:动态规划 难度:困难 --- 2019年03月30日 [664. 奇怪的打印机](https://github.com/hollischuang/algorithm/tree/master/leetcode/629-KInversePairsArray) [https://leetcode-cn.com/problems/strange-printer/](https://leetcode-cn.com/problems/strange-printer/) 英文官方题解: [https://leetcode.com/problems/strange-printer/solution/](https://leetcode.com/problems/strange-printer/solution/) 知识点:动态规划 难度:困难 --- 2019年04月01日 [943. 最短超级串](https://github.com/hollischuang/algorithm/tree/master/leetcode/943-FindTheShortestSuperstring) [https://leetcode-cn.com/problems/find-the-shortest-superstring/](https://leetcode-cn.com/problems/find-the-shortest-superstring/) 英文官方题解: [https://leetcode.com/articles/find-the-shortest-superstring/](https://leetcode.com/articles/find-the-shortest-superstring/) 知识点:动态规划 难度:困难 --- 2019年04月02日 [32. 最长有效括号](https://github.com/hollischuang/algorithm/tree/master/leetcode/032-LongestValidParentheses) [https://leetcode-cn.com/problems/longest-valid-parentheses/](https://leetcode-cn.com/problems/longest-valid-parentheses/) 英文官方题解: [https://leetcode.com/articles/longest-valid-parentheses/](https://leetcode.com/articles/longest-valid-parentheses/) 知识点:动态规划 难度:困难 --- 2019年04月03日 [403. 青蛙过河](https://github.com/hollischuang/algorithm/tree/master/leetcode/403-FrogJump) [https://leetcode-cn.com/problems/frog-jump/](https://leetcode-cn.com/problems/frog-jump/) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/frog-jump/discuss/88824/Very-easy-to-understand-JAVA-solution-with-explanations](https://leetcode.com/problems/frog-jump/discuss/88824/Very-easy-to-understand-JAVA-solution-with-explanations) 知识点:动态规划 难度:困难 --- 2019年04月04日 [321. 拼接最大数](https://github.com/hollischuang/algorithm/tree/master/leetcode/321-CreateMaximumNumber) [https://leetcode.com/problems/create-maximum-number/discuss/77285/Share-my-greedy-solution](https://leetcode.com/problems/create-maximum-number/discuss/77285/Share-my-greedy-solution) 无官方题解,网友高票Java解法: [https://leetcode.com/problems/frog-jump/discuss/88824/Very-easy-to-understand-JAVA-solution-with-explanations](https://leetcode.com/problems/frog-jump/discuss/88824/Very-easy-to-understand-JAVA-solution-with-explanations) 知识点:动态规划 难度:困难 ---