Records thinking and code of Leetcode problems.
🍀 Wish everyone who struggles for getting a job has a good luck.
Code is written by C++ or Python or Java.
🚩 means that problem has Facebook tag in LeetCode.
📗 means I think it's better to memorize the statement since there are so many details to consider.
Content
- 2 pointers
- Array
- Backtracking
- BFS
- Binary Search
- Binary Tree
- BST
- DFS
- Divide and conquer
- Dynamic programming
- File
- Dijkstra
- Greedy
- Hash map
- Linked list
- NP
- Sort
- Stack and queue
- String
- Topological sort
- Trie
- Union find
- 76 Minimum Window Substring 🚩
- 438 Find All Anagrams in a String 🚩
- 995 Minimum Number of K Consecutive Bit Flips
- 1004
- 986 Interval List Intersections 🚩
- 3 Longest Substring Without Repeating Characters
- 287 Find the duplicate number
- 240 Search a 2D Matrix II
- 442 Find All Duplicates in an Array
- 31 Next Permutation 🚩
- 154 Find Minimum in Rotated Sorted Array II
- 81 Search in Rotated Sorted Array II
- 410 Split Array Largest Sum
- 173 Binary Search Tree Iterator 🚩
- 105 Construct Binary Tree from Preorder and Inorder Traversal
- 106 Construct Binary Tree from Inorder and Postorder Traversal
- 124 Binary Tree Maximum Path Sum 🚩
- 958 Check Completeness of a Binary Tree 🚩
- 110 Balanced Binary Tree 📗
- Iterative in-order traverse 📗
- 173
- 426 Convert Binary Search Tree to Sorted Doubly Linked List 🚩
- 617
- 95 Unique Binary Search Trees II
- 98 Validate Binary Search Tree
- 314 Binary Tree Vertical Order Traversal 🚩
- 199 Binary Tree Right Side View 🚩
- 279
- 1210 Minimum Moves to Reach Target with Rotations
- 542 01 Matrix
- 317 Shortest Distance from All Buildings 🚩
- 490 The Maze
- maze solver
- 301 Remove Invalid Parentheses 🚩
- 282 Expression Add Operators 🚩
- 39 Combination Sum
- 46 Permutations
- 47 Permutations II
- Basic operation
- Gray code
- 137 Single Number II
- 973 K Closest Points to Origin 🚩
- 493 Reverse Pairs
- 315 Count of Smaller Numbers After Self
- 327 Count of Range Sum
- 51 N-Queens
- 785 Is Graph Bipartite? 🚩
- 543
- 200
- 1239 Maximum Length of a Concatenated String with Unique Characters
- 0-1 knapsack
- Longest Common Substring
- 1092 Shortest Common Supersequence
- 1105 Filling Bookcase Shelves
- 322 Coin Change
- 152 Maximum Product Subarray
- 639 Decode Ways II
- 91 Decode ways
- 139 Word Break
- 188 Best Time to Buy and Sell Stock IV
- 560 Subarray Sum Equals K 🚩
- 403 frog jump
- 一个 string 返回最长的重复 string
- 343 Integer Break
- 474 Ones and Zeroes
- 1027 Longest Arithmetic Sequence 🚩
- 714 Best Time to Buy and Sell Stock with Transaction Fee
- 123 Best Time to Buy and Sell Stock III
- 518 Coin Change 2
- 309 Best Time to Buy and Sell Stock with Cooldown
- 10 Regular Expression Matching
- 621 Task Scheduler 🚩
- 253 Meeting room II
- 53 Maximum Subarray
- 1383 Maximum Performance of a Team 📗
- 560 Subarray Sum Equals K 🚩
- 325 Maximum Size Subarray Sum Equals k
- 311 Sparse Matrix Multiplication
- 最大公约数(Greatest common divisor) 📗
- 991 Broken Calculator
- 50 Pow(x, n) 🚩
- 523 Continuous Subarray Sum 🚩
- 825. Friends Of Appropriate Ages 🚩
- 7 Reverse Integer 📗
- 1363 Largest Multiple of Three
- 17
- 1078 Occurrences After Bigram
- 125 Valid Palindrome 🚩
- 680 Valid Palindrome II 🚩
- 161 One Edit Distance 🚩 📗
- 65 Valid Number 🚩
- RK algorithm 📗
- 1392 Longest Happy Prefix
- 23 Merge k Sorted Lists 🚩
- 232 Implement Queue using Stacks
- 225 Implement Stack using Queues
- 739 Daily Temperatures
- 269 Alien Dictionary 🚩
- 210