LeetCode整理【下】
牢记
复盘比实战更重要
老树盘根
- 根到叶子节点表示的数字加和······Sum Root to Leaf Numbers
- 树的指针next统统向右······Populating Next Right Pointers in Each Node
- 树的指针next统统向右 II······Populating Next Right Pointers in Each Node II······仙人指路
排列组合:
- 枚举IP地址······ Restore IP Addresses
- N皇后······ N-Queens
- N皇后问题解的个数······ N-Queens II
- 排出括号的各种组合······ Generate Parentheses
- 输出电话号码字母组合······ Letter Combinations of a Phone Number
链表:
- 链表的归并排序······Sort List······仙人指路
- 链表的插入排序······Insertion Sort List
- 链表重排······Reorder List······引申问题-完美洗牌
- 链表分区······ Partition List
- 链表旋转······ Rotate List
- 以k为一组反转链表······ Reverse Nodes in k-Group
kSum系列
- 3 Sum······ 3Sum
- 3 Sum Closest······ 3Sum Closest
- 4 Sum······ 4Sum
2 Pointer:
- 回文验证·······Valid Palindrome
其它:
- LRU Cache·······LRU Cache ······仙人指路······首先你要懂得什么是Least Recnetly Used Cached策略
- 发糖果·······Candy······仙人指路,牛逼的两遍法
- 图的深拷贝·······Clone Graph
- 生成杨辉三角·······Pascal's Triangle
- 生成杨辉三角II·······Pascal's Triangle
- 俩排序数组合并······· Merge Sorted Array
- 删除排序数组中的重复元素······· Remove Duplicates from Sorted Array
- 删除排序数组中的重复元素II······· Remove Duplicates from Sorted Array II
- 矩阵置0······· Set Matrix Zeroes
- 大数+1······· Plus One
- 大数加法······· Add Binary
- 合法数字字符串······· Valid Number······仙人指路
- 二维矩阵螺旋遍历······· Spiral Matrix
- 生成螺旋二维矩阵······· Spiral Matrix II
- 生成螺旋二维矩阵······· Spiral Matrix II
- 图像旋转······· Rotate Image
- 跳跃游戏······· Jump Game
- 跳跃游戏II······· Jump Game II·······仙人指路
- 找到所有颠倒字母而成的字······· Anagrams
- 找到所有颠倒字母而成的字······· Count and Say
- 找到所有颠倒字母而成的字······· Valid Sudoku
- 不用除法乘法的两数相除······· Divide Two Integers
- 数字转换成罗马数字······· Integer to Roman
- 罗马数字转换成数字······· Roman to Integer
DFS & BFS
- 树的根节点与叶子节点路径相加和······Path Sum
- 单词阶梯······Word Ladder
- 树形混乱字符串······ Scramble String······仙人指路
- 正则匹配的变形······ Wildcard Matching
Math
排序与查找
- 查找最长连续序列······Longest Consecutive Sequence
- 仨数排序······ Sort Colors
- 在2D矩阵上查找······ Search a 2D Matrix
- 插入interval······ Insert Interval
- 合并interval······ Merge Intervals
- 查找第一个缺失的正数······ First Missing Positive
动态规划
- 加油站······Gas Station
- 回文分割······Palindrome Partitioning
- 回文分割II······Palindrome Partitioning II
- 一个String生成另一个String······Distinct Subsequences······仙人指路1······仙人指路2
- 两个字符串生成一个字符串······ Interleaving String
- 找出有多少种编码方式······ Decode Ways
- 编辑距离······ Edit Distance······仙人指路
- 爬楼梯······ Climbing Stairs
- 最短路径和······ Minimum Path Sum
- 最长回文子串······ Longest Palindromic Substring
堆栈问题
大数问题
- 大数乘法······ Multiply Strings
字符串
- 计算最后一个单词的长度······ Length of Last Word
- 实现子串查找······ Implement strStr()
- 经典的atoi······ String to Integer (atoi)
Devide & Conquer
- 经典的计算x的n次方······ Pow(x, n)
- 装水问题······ Trapping Rain Water