Leetcode
Introduction
1.
First Chapter
1.1.
LC340 Longest Substring with At Most K Distinct Characters
1.2.
LC323 Number of Connected Components in an Undirected Graph
1.3.
LC255 Verify Preorder Sequence in Binary Search Tree
1.4.
LC254 Factor Combinations
1.5.
LC3 Longest Substring Without Repeating Characters
1.6.
LC265 Paint House II
1.7.
LC250 Count Univalue Subtrees
1.8.
LC329 Longest Increasing Path in a Matrix
1.9.
LC298 Binary Tree Longest Consecutive Sequence
1.10.
LC163 Missing Ranges
1.11.
LC325 Maximum Size Subarray Sum Equals k
1.12.
LC121 Best Time to Buy and Sell Stock
1.13.
LC101 Symmetric Tree
1.14.
LC118 Pascal's Triangle
1.15.
LintCode Permutation Index
1.16.
LintCode Permutation Index II
1.17.
Leetcode Wood Cut
1.18.
LintCode Delete Digits
1.19.
LeetCode35 Search Insert Position
1.20.
LC129 Sum Root to Leaf Numbers
Powered by
GitBook
Leetcode
LC265 Paint House II
维护一个全局最小和一个全局第二小的值,然后维护一个上次指向全局最小的坐标,如果本次遍历的时候坐标正好等于上一次全局最小的坐标,则加第二小的值,然后不断更信最小,第二小,和最小的坐标。