Leetcode Leetcode Question & Solutions Binary Search 二分搜索 Leetcode 34 Find First and Last Position of Element in Sorted Array(Python) Leetcode 35 Search Insert Position(Python) Leetcode 704 Binary Search(Python) Leetcode 875 Koko Eating Bananas(Python) Leetcode 1011 Capacity To Ship Packages Within D Days(Python) Leetcode 4 Median of Two Sorted Arrays Leetcode 475 Heaters Leetcode 162 Find Peak Element Leetcode 875 Koko Eating Bananas Leetcode 1011 Capacity To Ship Packages Within D Days Leetcode 1060 Missing Element in Sorted Array Leetcode 1539 Kth Missing Positive Number Binary Tree 二叉树 Leetcode 95 Unique Binary Search Trees II(Python) Leetcode 98 Validate Binary Search Tree Leetcode 98 Validate Binary Search Tree(Python) Leetcode 99 Recover Binary Search Tree Leetcode 99 Recover Binary Search Tree(Python) Leetcode 100 SameTree Leetcode 100 SameTree(Python) Leetcode 101 Symmetric Tree Leetcode 101 Symmetric Tree(Python) Leetcode 102 Binary Tree Level Order Traversal Leetcode 102 Binary Tree Level Order Traversal(Python) Leetcode 103 Binary Tree Zigzag Level Order Traversal Leetcode 103 Binary Tree Zigzag Level Order Traversal(Python) Leetcode 104 Maximum Depth of Binary Tree Leetcode 666 Path Sum IV Leetcode 104 Maximum Depth of Binary Tree(Python) Leetcode 105 Construct Binary Tree from Preorder and Inorder Traversal Leetcode 105 Construct Binary Tree from Preorder and Inorder Traversal(Python) Leetcode 106 Construct Binary Tree from Inorder and Postorder Traversal Leetcode 106 Construct Binary Tree from Inorder and Postorder Traversal(Python) Leetcode 107 Binary Tree Level Order Traversal II(Python) Leetcode 109 Convert Sorted List to Binary Search Tree(Python) Leetcode 124 Binary Tree Maximum Path Sum Leetcode 236 Lowest Common Ancestor of a Binary Tree Leetcode 366 Find Leaves of Binary Tree Leetcode 1644 Lowest Common Ancestor of a Binary Tree II Leetcode 1650 Lowest Common Ancestor of a Binary Tree III Leetcode 1676 Lowest Common Ancestor of a Binary Tree IV Leetcode 272 Closest Binary Search Tree Value II Leetcode 298 Binary Tree Longest Consecutive Sequence Leetcode 314 Binary Tree Vertical Order Traversal Leetcode 515 Find Largest Value in Each Tree Row Leetcode 987 Vertical Order Traversal of a Binary Tree Leetcode 530 Minimum Absolute Difference in BST Leetcode 543 Diameter of Binary Tree Leetcode 545 Boundary of Binary Tree Leetcode 654 Maximum Binary Tree Leetcode 1361 Validate Binary Tree Nodes Leetcode 1660 Correct a Binary Tree Leetcode 1666 Change the Root of a Binary Tree Breadth-first search 广度优先搜索 Leetcode 111 Minimum Depth of Binary Tree Leetcode 130 Surrounded Regions Leetcode 210. Course Schedule II Leetcode 513 Find Bottom Left Tree Value(TODO) Leetcode 515 Find Largest Value in Each Tree Row Leetcode 529 Minesweeper Leetcode 785 Is Graph Bipartite? Leetcode 994 Rotting Oranges Leetcode 419 Battleships in a Board Leetcode 815 Bus Routes Leetcode 2115 Find All Possible Recipes from Given Supplies Depth-first search 深度优先搜索 Leetcode 22 Generate Parentheses Leetcode 39 Combination Sum Leetcode 40 Combination Sum II Leetcode 46 Permutations Leetcode 47 Permutations II Leetcode 51 N-Queens Leetcode 77 Combinations Leetcode 78 Subsets Leetcode 79 Word Search Leetcode 90 Subsets II Leetcode 216 Combination Sum III Leetcode 216 Combination Sum III Leetcode 465 Optimal Account Balancing Data Structure 数据结构 Leetcode 146 LRU Cache Leetcode 460 LFU Cache Design 设计类问题 Leetcode 348 Design Tic-Tac-Toe Leetcode 588 Design In-Memory File System LinkedList 链表问题 Leetcode 19 Remove Nth Node From End of List(Python) Leetcode 21 Merge Two Sorted Lists(Python) Leetcode 23 Merge k Sorted Lists(Python) Leetcode 25 Reverse Linked List in K group Leetcode 25 Reverse Linked List in K group(Python) Leetcode 83 Remove Duplicates from Sorted List(Python) Leetcode 92 Reverse Linked List II Leetcode 92 Reverse Linked List II(Python) Leetcode 141 Linked List Cycle(Python) Leetcode 142 Linked List Cycle II(Python) Leetcode 160 Intersection of Two Linked Lists(Python) Leetcode 206 Reverse Linked List Leetcode 206 Reverse Linked List(Python) Leetcode 234 Palindrome Linked List Leetcode 234 Palindrome Linked List Leetcode 234 Palindrome Linked List(Python) Prefix Sum Array 前缀和数组 Leetcode 303 Range Sum Query - Immutable Leetcode 304 Range Sum Query 2D - Immutable Leetcode 370 Range Addition Leetcode 528 Random Pick with Weight Leetcode 724 Find Pivot Index Leetcode 930 Binary Subarrays With Sum Leetcode 974 Subarray Sums Divisible by K Leetcode 1109 Corporate Flight Bookings Leetcode 1177 Can Make Palindrome from Substring Leetcode 1413 Minimum Value to Get Positive Step by Step Sum Leetcode 1422 Maximum Score After Splitting a String Leetcode 1480 Running Sum of 1d Array Leetcode 1588 Sum of All Odd Length Subarrays(This is not a easy, it is actually hard) Leetcode 1732 Find the Highest Altitude Leetcode 1893 Check if All the Integers in a Range Are Covered Trie 前缀树 Leetcode 208 Implement Trie (Prefix Tree) Leetcode 211 Design Add and Search Words Data Structure Leetcode 648 Replace Words Leetcode 677 Map Sum Pairs Leetcode 1268 Search Suggestions System Leetcode 1804 Implement Trie II (Prefix Tree) Arrays 数组问题 Leetcode 1637 Widest Vertical Area Between Two Points Containing No Points Two pointer 双指针问题 Arrays 数组应用 Leetcode 5 Longest Palindromic Substring Leetcode 26 Remove Duplicates from Sorted Array Leetcode 27 Remove Element Leetcode 287 Find the Duplicate Number Leetcode 283 Move zeros Leetcode 2422 Merge Operations to Turn Array Into a Palindrome LinkedList 链表应用 Leetcode 21 Merge Two Sorted Lists Leetcode 23 Merge k Sorted Lists Leetcode 19 Remove Nth Node From End of List Leetcode 83 Remove Duplicates from Sorted List Leetcode 876 Middle of the Linked List Leetcode 141 Linked List Cycle Leetcode 160 Intersection of Two Linked Lists Sliding window 滑动窗口 Leetcode 3 Longest Substring Without Repeating Characters Leetcode 424 Longest Repeating Character Replacement Leetcode 76 Minimum Window Substring Leetcode 239 Sliding Window Maximum Leetcode 438 Find All Anagrams in a String Leetcode 567 Permutation in String Leetcode 1151 Minimum Swaps to Group All 1's Together Monotonous stack 单调栈问题 Leetcode 84 Largest Rectangle in Histogram Leetcode 739 Daily Temperatures Leetcode 907 Sum of Subarray Minimums Leetcode 503. Next Greater Element II Leetcode 2104 Sum of Subarray Ranges Stack 栈问题 Leetcode 20 Valid Parentheses Leetcode 155 Min Stack Leetcode 150 Evaluate Reverse Polish Notation Leetcode 224 Basic Calculator Leetcode 227 Basic Calculator II Leetcode 772 Basic Calculator III Greedy 贪心算法 Leetcode 1024 Video Stitching DP 动态规划 House Robber Problem 打家劫舍问题 Buy and Sell Stock 股票买卖问题 Knapsack Problem 背包问题 Leetcode 72 Edit Distance Leetcode 300 Longest increasing subsequence Leetcode 583 Delete Operation for Two Strings Leetcode 712 Minimum ASCII Delete Sum for Two Strings Leetcode 907 Sum of Subarray Minimums Leetcode 1143 Longest Common subsequence Leetcode 1567 Maximum Length of Subarray With Positive Product Graph 图算法 Floyd Algorithm 弗洛伊德算法 Leetcode 1334 Find the City With the Smallest... Dijkstra Algorithm 迪杰斯特拉算法 Leetcode 734 Network Delay Time Leetcode 1514 Path with Maximum Probability Leetcode 1631 Path With Minimum Effort BFS 广度优先搜索 Leetcode 210 Course Schedule II DFS 深度优先搜索 Leetcode 207 Course Schedule Leetcode 797 All Paths From Source to Target Biparted Graph 二分图问题 Leetcode 785 Is Graph Bipartite? Leetcode 886 Possible Bipartition Celebrity Problem 名流问题 Leetcode 277 Find the Celebrity UnionFind 并查集 Leetcode 261 Graph Valid Tree Leetcode 323 Number of Connected Components in an Undirected Graph Leetcode 547 Number of Provinces Leetcode 924 Minimize malware Leetcode 990 Satisfiability of Equality Equations Leetcode 1135 Connecting Cities With Minimum Cost Leetcode 1584 Min Cost to Connect All Points String 字符串相关问题 Leetcode 161 One Edit Distance Leetcode 299 Bulls and Cows Leetcode 418 Sentence Screen Fitting Leetcode 696 Count Binary Substrings Leetcode 926 Count Binary Substrings Leetcode 1758 Minimum Changes To Make Alternating Binary String Leetcode 1864 Minimum Number of Swaps to Make the Binary String Alternating Heap 堆相关问题 Leetcode 253 Meeting Rooms II Leetcode 973 K Closest Points to Origin Leetcode 1167 Minimum Cost to Connect Sticks Leetcode 1353 Maximum Number of Events That Can Be Attended Leetcode 2268 Minimum Number of Keypresses SegmentTree 线段树 线段树模板