LeetCode
LeetCode copied to clipboard
[公司] DoorDash
30天内高频
- [x] 124. Binary Tree Maximum Path Sum
- [x] 286. Walls and Gates
- BFS (⚠️注意复杂度分析)
- [x] 329. Longest Increasing Path in a Matrix
- DFS + Memoization
- [x] ✅⭐1235. Maximum Profit in Job Scheduling
- Binary Search, 查找右边界
- [x] ✅⭐658. Find K Closest Elements
- Binary Search, 查找右边界
- [x] 875. Koko Eating Bananas
- Binary Search, 查找右边界
- [x] 1790. Check if One String Swap Can Make Strings Equal
- [x] 1664. Ways to Make a Fair Array
- 很有意思,题意理解很重要
- [x] 1268. Search Suggestions System
- Trie
- [x] ✅⭐224. Basic Calculator
- [x] 2049. Count Nodes With the Highest Score
- 要点是计算出每个节点有多少个子节点:
score = size(curr.left) * size(curr.right) * size(remaining)
- 要点是计算出每个节点有多少个子节点:
3个月内高频
- [x] 1235. Maximum Profit in Job Scheduling
- Binary Search, Find lower bound
- [x] 826. Most Profit Assigning Work【Sorting + Binary Search】
- [x] 286. Walls and Gates
- BFS from gates
- [x] ✅⭐1834. Single-Threaded CPU [PriorityQueue]
- [x] 1790. Check if One String Swap Can Make Strings Equal [Two pointers]
- [x] 124. Binary Tree Maximum Path Sum
- 在处理这个 TreeNode 的时候,要做两件事:1. 检查通过该节点的最大路径值,2. 通过该节点时的最大半径
- [x] 329. Longest Increasing Path in a Matrix
- DFS + Memoization
- [x] Trie
- [x] 859. Buddy Strings
- [x] 1790. Check if One String Swap Can Make Strings Equal [Two pointers]
- [ ] 1347. Minimum Number of Steps to Make Two Strings Anagram
- [ ] 875. Koko Eating Bananas
- Binary Search
- [x] 1779. Find Nearest Point That Has the Same X or Y Coordinate
- 直接遍历,Direct traversal
- [x] 🟥✅⭐317. Shortest Distance from All Buildings
- BFS, 从每个building出发
- [x] 1. Two Sum
- [x] 210. Course Schedule II
- BFS + indegree, indegree 为 0,说明这节课课完成
- [x] 🟥✅⭐296. Best Meeting Point
- [x] ✅⭐987. Vertical Order Traversal of a Binary Tree
- BFS
- [x] 658. Find K Closest Elements
- Binary Search
- [x] ✅⭐2049. Count Nodes With the Highest Score
- Method 1: Build a tree, then count the number of nodes in each subtree
- Method 2: Count number of nodes rooted at i
- [x] 556. Next Greater Element III
- Math
- [x] 1664. Ways to Make a Fair Array
- [x] 1143. Longest Common Subsequence
- DP
- [ ] 695. Max Area of Island
- DFS to get size of each compoenent
- [x] ✅⭐224. Basic Calculator
- [ ] 45. Jump Game II
- Greedy, 贪心
Sorting + PriorityQueue
- 1834. Single-Threaded CPU
- 502. IPO
- 630. Course Schedule III
- 857. Minimum Cost to Hire K Workers
- 1353. Maximum Number of Events That Can Be Attended
502.IPO (H-) 630.Course-Schedule-III (H) 857.Minimum-Cost-to-Hire-K-Workers (H) 1353.Maximum-Number-of-Events-That-Can-Be-Attended (H-) 1834.Single-Threaded-CPU (M)