Giter VIP home page Giter VIP logo

leetcode's Introduction

LeetCode collection.

Date Question Numbers ✨ Star !
数组和动态数组
73. Set Matrix Zeroes
48. Rotate Image
344. Reverse String
414. Third Maximum Number
448. Find All Numbers Disappeared in an Array
66. Plus One
238. Product of Array Except Self
697. Degree of an Array
849. Maximize Distance to Closest Person
递归
509. Fibonacci Number
78. Subsets
90. Subsets II
60. Permutation Sequence
784. Letter Case Permutation
46. Permutations
47. Permutations II
31. Next Permutation
39. Combination Sum
40. Combination Sum II
22. Generate Parentheses
51. N-Queens
二分搜索
34. Find First and Last Position of Element in Sorted Array 1-yes
35. Search Insert Position 1-yes
658. Find K Closest Elements 1-no
33. Search in Rotated Sorted Array 1-no
81. Search in Rotated Sorted Array II 1-no
153. Find Minimum in Rotated Sorted Array
702. Search in a Sorted Array of Unknown Size 这个题定量分析 ! 1-no bilibili
74. Search a 2D Matrix 1-no
240. Search a 2D Matrix II 1-no
162. Find Peak Element 1-no
69. Sqrt(x) 1-yes
4. Median of Two Sorted Array 和下面的题是一样的
Laicode: Kth Smallest In Two Sorted Arrays 这个题非常重要!可以到 logn+logk bilibili
378. Kth Smallest Element in a Sorted Matrix
189. Rotate Array
7. Reverse Integer
475. Heaters
56. Merge Intervals
57. Insert Interval
349. Intersection of Two Arrays
经验:并不是所有二分法都适用于 left+1<right, 对于可以排除mid的问题,使用left<=right更简便
排序
969. Pancake Sorting 还没做
347. Top K Frequent Elements 桶排序
分治法
50. Pow(x, n)
215. Kth Largest Element in an Array
349. Intersection of Two Arrays
350. Intersection of Two Arrays II
493. Reverse Pairs
53.Maximum Subarray 这题实际是动态规划
311. Sparse Matrix Multiplication
523. Continuous Subarray Sum
241. Different Ways to Add Parentheses 分治,递归
139. Word Break
140. Word Break II
链表
237. Delete Node in a Linked List
876. Middle of the Linked List
141. Linked List Cycle
142. Linked List Cycle II (找到环的开始)
19. Remove Nth Node From End of List
21. Merge Two Sorted Lists
160. Intersection of Two Linked Lists
147. Insertion Sort List
148. Sort List
86. Partition List
206. Reverse Linked List
92. Reverse Linked List II
25. Reverse Nodes in k-Group 没做出来,要重新看一遍
234. Palindrome Linked List 回文 不会
83. Remove Duplicates from Sorted List
82. Remove Duplicates from Sorted List II
287. Find the Duplicate Number 兔子和乌龟
61. Rotate List 还没做
堆栈和队列
232. Implement Queue using Stacks
225. Implement Stack using Queues
155. Min Stack
20. Valid Parentheses
71. Simplify Path
394. Decode String
682. Baseball Game
735. Asteroid Collision
503. Next Greater Element II
739. Daily Temperatures
239. Sliding Window Maximum 还没做,优先考虑用队列的方法
224. Basic Calculator
456. 132 Pattern
402. Remove K Digits
946. Validate Stack Sequences
621. Task Scheduler 还没做
622. Design Circular Queue 还没做
哈希表
387. First Unique Character in a String
349. Intersection of Two Arrays
350. Intersection of Two Arrays II
771. Jewels and Stones
217. Contains Duplicate
219. Contains Duplicate II
811. Subdomain Visit Count
500. Keyboard Row
290. Word Pattern
146. LRU Cache
104. Maximum Depth of Binary Tree
110. Balanced Binary Tree
98. Validate Binary Search Tree
101. Symmetric Tree
100. Same Tree
700. Search in a Binary Search Tree
701. Insert into a Binary Search Tree 见算法导论 165
94. Binary Tree Inorder Traversal 用栈实现iterative
144. Binary Tree Preorder Traversal
145. Binary Tree Postorder Traversal
102. Binary Tree Level Order Traversal 这个一道BFS
107. Binary Tree Level Order Traversal II
103. Binary Tree Zigzag Level Order Traversal
105. Construct Binary Tree from Preorder and Inorder Traversal 这题不太理解本质
108. Convert Sorted Array to Binary Search Tree
109. Convert Sorted List to Binary Search Tree
111. Minimum Depth of Binary Tree
112. Path Sum
113. Path Sum II
437. Path Sum III
235. Lowest Common Ancestor of a Binary Search Tree
236. Lowest Common Ancestor of a Binary Tree
230. Kth Smallest Element in a BST 还没做
450. Delete Node in a BST 还没做
938. Range Sum of BST 还没做
215. Kth Largest Element in an Array y
692. Top K Frequent Words
263. Ugly Number
264. Ugly Number II
373. Find K Pairs with Smallest Sums n
23. Merge k Sorted Lists
295. Find Median from Data Stream
502. IPO
451. Sort Characters By Frequency 还没做
871. Minimum Number of Refueling Stops 还没做
图论
宽度优先搜索 重要:能用BFS做的题,就不要用DFS!
200. Number of Islands
611. Knight Shortest Path 用字典可以记录 见过的点,和对应距离
133. Clone Graph
297. Serialize and Deserialize Binary Tree 这个题还是有点蒙
127. Word Ladder
拓扑排序
207. Course Schedule
210. Course Schedule II
444. Sequence Reconstruction
Lint-127. Topological Sorting
----
490. The Maze
505. The Maze II 黑色(已经pop出来的,才放seen)不压栈,不压队。Dijkstra是BFS
499. The Maze III
733. Flood Fill
547. Friend Circles
695. Max Area of Island stack,queue,只要append完了,立刻放seen
690. Employee Importance
785. Is Graph Bipartite? n
417. Pacific Atlantic Water Flow
329. Longest Increasing Path in a Matrix
542. 01 Matrix n 不会
721. Accounts Merge 考察点,把数据转换成图
210. Course Schedule II
630. Course Schedule III
997. Find the Town Judge
407. Trapping Rain Water II 还没做
743. Network Delay Time
双指针
26. Remove Duplicates from Sorted Array 兔子乌龟
344. Reverse String
1. Two Sum 其实这个是哈希表
167. Two Sum II - Input array is sorted
21. Merge Two Sorted Lists
349. Intersection of Two Arrays
523. Continuous Subarray Sum 不会
169. Majority Element
229. Majority Element II 摩尔投票算法
75. Sort Colors 荷兰国旗:很经典的一道题
11. Container With Most Water 装水的题
42. Trapping Rain Water 不会
15. 3Sum
16. 3Sum Closest
125. Valid Palindrome
滑动窗口
845. Longest Mountain in Array 未做
26. Remove Duplicates from Sorted Array
80. Remove Duplicates from Sorted Array II
27. Remove Element
643. Maximum Average Subarray I
209. Minimum Size Subarray Sum 没有写出来,清醒的时候重新写
28. Implement strStr()
713. Subarray Product Less Than K
3. Longest Substring Without Repeating Characters
438. Find All Anagrams in a String
76. Minimum Window Substring
159. Longest Substring with At Most Two Distinct Characters 还没做
340. Longest Substring with At Most K Distinct Characters 还没做
239. Sliding Window Maximum 可以用堆 还没做
动态规划
198. House Robber
213. House Robber II
337. House Robber III
746. Min Cost Climbing Stairs
96. Unique Binary Search Trees 科特兰数
714. Best Time to Buy and Sell Stock with Transaction Fee
309. Best Time to Buy and Sell Stock with Cooldown 还没做
32. Longest Valid Parentheses 还没做
72. Edit Distance 还没做
70. Climbing Stairs 还没做
九章算法 动态规划:
322. Coin Change 典型
62. Unique Paths 计数型动态规划
63. Unique Paths II 坐标型动态规划
55. Jump Game 存在型动态规划
152. Maximum Product Subarray
91. Decode Ways 划分型动态规划
64. Minimum Path Sum 坐标型 (可以用滚动数组节省空间)
361. Bomb Enemy 坐标型
674. Longest Continuous Increasing Subsequence
338. Counting Bits
序列型动态规划:
Lint-843. Digital Flip
256. Paint House 序列型动态规划
265. Paint House II
121. Best Time to Buy and Sell Stock
122. Best Time to Buy and Sell Stock II
123. Best Time to Buy and Sell Stock III
188. Best Time to Buy and Sell Stock IV 还没做
300. Longest Increasing Subsequence
354. Russian Doll Envelopes 是300的二维问题
划分型动态规划
279. Perfect Squares
132. Palindrome Partitioning II
Lint-437. Copy Books
博弈型动态规划
Lint-394. Coins in a Line
背包型动态规划 --- 背包的总承重通常都需要放在状态里
Lint-92. Backpack 可行性
Lint-563. Backpack V 计数型
Lint-564. Combination Sum IV 计数型
Lint-125. Backpack II 最值型
Lint-440. Backpack III 最值型 这一题可以一维数组把空间优化到极致,见视频讲解
区间型动态规划 取头 取尾
516. Longest Palindromic Subsequence 在区间问题中,要按照区间长度的顺序计算
记忆化搜索,可以大大降低冗余。自上而下
5. Longest Palindromic Substring
Lint-396. Coins in a Line III
87. Scramble String
312. Burst Balloons 消去型题目
双序列动态规划
Lint-77. Longest Common Subsequence
97. Interleaving String
72. Edit Distance
10. Regular Expression Matching
474. Ones and Zeroes
115. Distinct Subsequences
44. Wildcard Matching 还没做
动态规划难题专场
221. Maximal Square
639. Decode Ways II 还没做
Lint-752. Rogue Knight Sven
Lint-971. Surplus Value Backpack 这道题不用掌握
Lint-89. k Sum
贪心算法
455. Assign Cookies
435. Non-overlapping Intervals 其实是活动选择问题
位操作
29. Divide Two Integers
191. Number of 1 Bits
405. Convert a Number to Hexadecimal 不会
231. Power of Two
268. Missing Number
397. Integer Replacement 还没做
371. Sum of Two Integers
172. Factorial Trailing Zeroes 还没做
字符串
551. Student Attendance Record I
760. Find Anagram Mappings
5. Longest Palindromic Substring
242. Valid Anagram
796. Rotate String
9. Palindrome Number 还没做
409. Longest Palindrome
266. Palindrome Permutation
516. Longest Palindromic Subsequence
524. Longest Word in Dictionary through Deleting 还没做
392. Is Subsequence
79. Word Search 还没做
212. Word Search II 还没做
648. Replace Words 还没做
6. ZigZag Conversion
8. String to Integer (atoi)
12. Integer to Roman
13. Roman to Integer
14. Longest Common Prefix
Question Numbers ✨ Star ! Second Third Forth Fifth
1-10
11-20
21-30

心得:

  1. heap 特别适合用于解决有 candidate pool 的问题

leetcode's People

Contributors

shiminlei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.