Leetcode

2. Add Two Numbers: 难度简单,利用了数字相加的进位的原理。
1028. Conver to Base - 2: 难度中等,进位原理。
1030. Next Greater Node In Linked List: 难度简单,使用栈。
1020. Number of Enclaves: 难度中等,可以用图的算法,但是用遍历更简单。
83. Remove Duplicates from Sorted List: 难度简单,链表。
82. Remove Duplicates from Sorted List II:难度简单,需要引入一个前置节点。
559. Maximum Depth of N-ary Tree: 难度简单,动态规划。
[198. House Robber]: 难度简单,动态规划,利用循环将最优解传递。
[213. House Robber ii]: 难度简单,动态规划,利用循环将最优解传递。
[509. Fibonacci Number]: 难度简单,斐波那契数列。
[307. Range Sum Query - Mutable]:Easy。
[1025. Divisor Game]: 难度中等,动态规划求解。
[1026. Maximum Difference Between Node and Ancestor]: 难度简单,动态规划求解。
[1027. Longest Arithmetic Sequence]: 难度中等,动态规划。
[1028. Recover a Tree From Preorder Traversal]: 难度中等,使用depth和ArrayBuffer[TreeNode]来存储中间计算结果。
234. Palindrome Linked List: 难度简单。
203. Remove Linked List Elements: 难度简单。
160. Intersection of Two Linked Lists: 难度简单。
700. Search in a Binary Search Tree: 难度简单。
617. Merge Two Binary Trees: 难度中等,递归思想。
350. Intersection of Two Arrays II: 难度简单。
704. Binary Search: 难度简单,二分查找。
744. Find Smallest Letter Greater Than Target: 难度简单,二分查找。
367. Valid Perfect Square: 难度简单,采用Long处理。
877. Stone Game: 难度中等,动态规划,使用矩阵的思想来做动态规划,是一个不错的思路。
931. Minimum Falling Path Sum: 难度中等,动态规划,知道上一题的矩阵解法,做这个也比较简单了。
983. Minimum Cost For Tickets: 难度简单,动态规划,从后往前的来考虑。
1030. Matrix Cells in Distance Order: 难度简单,使用广度遍历,竟然忘记广度遍历怎么写了。。。。BFS use Queue,DFS use Stack。。。
1029. Two City Scheduling: 难度简单,需要用点数学推导。
1031. Maximum Sum of Two Non-Overlapping Subarrays: 难度简单,但是过程的代码量可能要多一些。。。
1032. Stream of Characters: 难度简单,很容易就想到的方法。。。
374. Guess Number Higher or Lower: 难度简单,二分查找。
441. Arranging Coins: 难度简单,二分查找,找最近的那一个。
475. Heaters: 难度简单,遍历做二分查找,很傻的题目。
69. Sqrt(x): 难度简单,遍历做二分查找,最近值。
278. First Bad Version: 难度简单,同上。
981. Time Based Key-Value Store: 难度简单,偷懒用了跳表结构。
647. Palindromic Substrings: Hard,使用Manacher算法。
413. Arithmetic Slices: Easy,很简单的优化。
[1033. Moving Stones Until Consecutive]: 难度简单。
714. Best Time to Buy and Sell Stock with Transaction Fee: Hard,这个动态规划的点很难想到。
413. Arithmetic Slices: Easy,很简单的优化。
1034. Coloring A Border: Easy,BFS。
1035. Uncrossed Lines: Hard,动态规划,使用矩阵的方式。。第二次了。。
771. Jewels and Stones: Easy。
1103. Distribute Candies to People: Easy。
1104. Path In Zigzag Labelled Binary Tree: 比较有意思的一道题。
1093. Statistics from a Large Sample: Easy.
1094. Car Pooling: Easy.
1124. Longest Well-Performing Interval: Medium,采用简单的动态规划。
1122. Relative Sort Array: Easy。
1137. N-th Tribonacci Number: Easy。
1138. Alphabet Board Path: Easy。
1139. Largest 1-Bordered Square: Medium,很繁琐的一系列操作。
1144. Decrease Elements To Make Array Zigzag: Medium。
1145. Binary Tree Coloring Game: Medium,一次过。
491. Increasing Subsequences: Medium.
11. Container With Most Water: Easy.
15. 3Sum: Easy.
136. Single Number: Too easy.
796. Rotate String: Easy
50. Pow(x, n): Easy
337. House Robber III: Easy.
825. Friends Of Appropriate Ages: Easy.
701. Insert into a Binary Search Tree: Easy.
933. Number of Recent Calls: Easy.
1047. Remove All Adjacent Duplicates In String: Easy.
844. Backspace String Compare: Easy.
451. Sort Characters By Frequency: Easy.
43. Multiply Strings: Medium.
869. Reordered Power of 2: Medium.
870. Advantage Shuffle: Medium.
121. Best Time to Buy and Sell Stock: Easy.
122. Best Time to Buy and Sell Stock II: Easy.
503. Next Greater Element II: Medium.
168. Excel Sheet Column Title: Easy.
830. Positions of Large Groups: Easy.
101. Symmetric Tree: Easy.
78. Subsets: Easy.
207. Course Schedule: Medium,差点使用连通图,结果不是,用 stack 实现dfs。
257. Binary Tree Paths: Easy.
16. 3Sum Closest: Easy.
129. Sum Root to Leaf Numbers: Easy.
238. Product of Array Except Self: Easy.
686. Repeated String Match: Easy.
888. Fair Candy Swap: Easy.
1154. Day of the Year: Easy.
1155. Number of Dice Rolls With Target Sum: Medium,做个缓存.
1156. Swap For Longest Repeated Character Substring: Medium.
1002. Find Common Characters: Easy.
576. Out of Boundary Paths: Easy.
169. Majority Element: Easy.
229. Majority Element II: Easy.
1080. Insufficient Nodes in Root to Leaf Paths: Medium.
1146. Snapshot Array: Medium.
976. Largest Perimeter Triangle: Medium,要先做排序,还没想到。
693. Binary Number with Alternating Bits: Easy.
779. K-th Symbol in Grammar: Medium,开始的想法想错了。
905. Sort Array By Parity: Easy.
482. License Key Formatting: Easy.
3. Longest Substring Without Repeating Characters: Not too medium.
5. Longest Palindromic Substring: Easy.
17. Letter Combinations of a Phone Number: Easy.
19. Remove Nth Node From End of List: Easy.
22. Generate Parentheses: Medium.
98. Validate Binary Search Tree: Medium.
152. Maximum Product Subarray: Easy.
31. Next Permutation: Medium.
322. Coin Change: Medium.
142. Linked List Cycle II: Medium.
33. Search in Rotated Sorted Array: Easy.
102. Binary Tree Level Order Traversal: Easy.
34. Find First and Last Position of Element in Sorted Array: Easy.
139. Word Break: Medium.
208. Implement Trie (Prefix Tree): Medium. 这里实现的 Trie Tree 性能太差,如果以单个字母来实现,性能简直是差的可以。
114. Flatten Binary Tree to Linked List: Medium.
96. Unique Binary Search Trees: Medium.
94. Binary Tree Inorder Traversal: Easy.