🖊️
LeetCode整理
CtrlK
  • Common api
  • Data Structure
  • Algo
  • Backtracking Template -- General Approach (DFS)
    • 753. Cracking the Safe
    • 465. Optimal Account Balancing
    • 1088. Confusing Number II
    • 1372. Longest ZigZag Path in a Binary Tree
      • 494. Target Sum
    • 698. Partition to K Equal Sum Subsets
    • 473. Matchsticks to Square
    • 494. Target Sum
    • 491. Increasing Subsequences
    • 638. Shopping Offers
    • 695. Max Area of Island
    • 1457. Pseudo-Palindromic Paths in a Binary Tree
  • Card Set problem
  • Tree
    • 549. Binary Tree Longest Consecutive Sequence II
    • 776. Split BST
    • 652. Find Duplicate Subtrees
  • SubArray Sum
    • 560. Subarray Sum Equals K
    • 1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target
  • Others
    • 388. Longest Absolute File Path
    • 149. Max Points on a Line
    • 271. Encode and Decode Strings
    • 308. Range Sum Query 2D - Mutable
    • 631. Design Excel Sum Formula
    • 792. Number of Matching Subsequences
    • 1526. Minimum Number of Increments on Subarrays to Form a Target Array
    • 418. Sentence Screen Fitting
    • 853. Car Fleet
    • 1776. Car Fleet II
    • 1525. Number of Good Ways to Split a String
    • 1509. Minimum Difference Between Largest and Smallest Value in Three Moves
    • 843. Guess the Word
    • 686. Repeated String Match
    • 844. Backspace String Compare
    • 1405. Longest Happy String
  • Trie
    • 212. Word Search II
    • 211. Design Add and Search Words Data Structure
    • 208. Implement Trie (Prefix Tree)
    • 421. Maximum XOR of Two Numbers in an Array
    • 648. Replace Words
  • Union Find
    • 305. Number of Islands II
    • 399. Evaluate Division
    • 684. Redundant Connection
    • 765. Couples Holding Hands
    • 990. Satisfiability of Equality Equations
    • 1202. Smallest String With Swaps
  • ProrityQueue
    • 1057. Campus Bikes
    • 1834. Single-Threaded CPU
    • 1499. Max Value of Equation
    • 778. Swim in Rising Water
  • Binary Search
    • 1884. Egg Drop With 2 Eggs and N Floors
    • 1870. Minimum Speed to Arrive on Time
    • 4. Median(Kth element) of Two Sorted Arrays
    • 33. Search in Rotated Sorted Array
    • 153. Find Minimum in Rotated Sorted Array
    • 162. Find Peak Element
    • 1011. Capacity To Ship Packages Within D Days
    • 410. Split Array Largest Sum
    • 875. Koko Eating Bananas
    • 1482. Minimum Number of Days to Make m Bouquets
    • 668. Kth Smallest Number in Multiplication Table
    • 719. Find K-th Smallest Pair Distance
    • 1201. Ugly Number III
    • 878. Nth Magical Number
    • 1283. Find the Smallest Divisor Given a Threshold
    • 483. Smallest Good Base
    • 793. Preimage Size of Factorial Zeroes Function
    • 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
    • 1300. Sum of Mutated Array Closest to Target
    • PriorityQueue + Merge Sort
      • 373. Find K Pairs with Smallest Sums
      • 786. K-th Smallest Prime Fraction
    • 658. Find K Closest Elements
  • N sum
    • 1. Two Sum
    • 454. 4Sum II
    • 18. 4Sum
    • 15. 3Sum
  • Fast and slow pointer
    • 19. Remove Nth Node From End of List
    • 287. Find the Duplicate Number (1)
    • 202. Happy Number
  • Merge Sort - merge
    • 21. Merge Two Sorted Lists
    • 493. Reverse Pairs
    • 315. Count of Smaller Numbers After Self
    • 327. Count of Range Sum (1)
    • 88. Merge Sorted Array (1)
    • 986. Interval List Intersections
  • Dijkstra's Algo
    • 1368. Minimum Cost to Make at Least One Valid Path in a Grid
    • 1928. Minimum Cost to Reach Destination in Time
    • 1548. The Most Similar Path in a Graph
  • Two pointer
    • 167. Two Sum II - Input array is sorted
    • 11. Container With Most Water (1)
    • 881. Boats to Save People
  • Dynamic Programing
    • Others
      • 1406. Stone Game III
      • Unique subsequence count
        • 552. Student Attendance Record II
        • 940. Distinct Subsequences II
        • 1987. Number of Unique Good Subsequences
      • 1039. Minimum Score Triangulation of Polygon
      • 799. Champagne Tower
      • 1048. Longest String Chain
      • 1504. Count Submatrices With All Ones
    • Recursive + Memo + TopDown
      • 1444. Number of Ways of Cutting a Pizza
      • 1691. Maximum Height by Stacking Cuboids
      • 139. Word Break
      • 1140. Stone Game II
      • 1105. Filling Bookcase Shelves
      • HashMap
        • 1218. Longest Arithmetic Subsequence of Given Difference
      • 377. Combination Sum IV
      • 935. Knight Dialer
      • 808. Soup Servings
    • Kadens Algo (最大子序列)
      • 1191. K-Concatenation Maximum Sum
      • 1425. Constrained Subsequence Sum
    • Grid
      • 1139. Largest 1-Bordered Square
      • 764. Largest Plus Sign
      • 1277. Count Square Submatrices with All Ones
      • 1594. Maximum Non Negative Product in a Matrix
      • 931. Minimum Falling Path Sum
    • Sequence
      • 5. Longest Palindromic Substring
      • 1155. Number of Dice Rolls With Target Sum
      • 1027. Longest Arithmetic Subsequence
      • 1641. Count Sorted Vowel Strings
      • 718. Maximum Length of Repeated Subarray
      • 983. Minimum Cost For Tickets
      • 740. Delete and Earn
      • 413. Arithmetic Slices
      • 790. Domino and Tromino Tiling
      • 53. Maximum Subarray (1)
      • 1186. Maximum Subarray Sum with One Deletion
      • 801. Minimum Swaps To Make Sequences Increasing
      • 467. Unique Substrings in Wraparound String
      • 787. Cheapest Flights Within K Stops
      • 1043. Partition Array for Maximum Sum
      • 837. New 21 Game
      • 650. 2 Keys Keyboard
      • 877. Stone Game
      • 1130. Minimum Cost Tree From Leaf Values
      • 813. Largest Sum of Averages
      • 1024. Video Stitching
    • Game theory
      • 486. Predict the Winner
      • 464. Can I Win
    • Fibonacci Sequence
      • 873. Length of Longest Fibonacci Subsequence
    • DP - String
    • 871. Minimum Number of Refueling Stops
    • 0-1 knapsack
      • 312. Burst Balloons
      • 198. House Robber
      • 213. House Robber II
      • 337. House Robber III
      • 1049. Last Stone Weight II
      • 416. Partition Equal Subset Sum
      • 474. Ones and Zeroes
  • Sliding windows find the min/max
    • 727. Minimum Window Subsequence
    • 1610. Maximum Number of Visible Points
    • 3. Longest Substring Without Repeating Characters
    • 239. Sliding Window Maximum (1)
    • 209. Minimum Size Subarray Sum (1)
    • 395. Longest Substring with At Least K Repeating Characters
    • 340. Longest Substring with At Most K Distinct Characters
    • 424. Longest Repeating Character Replacement
    • 1234. Replace the Substring for Balanced String
    • 904. Fruit Into Baskets
    • 567. Permutation in String
    • Sliding windows find the count
    • 713. Subarray Product Less Than K
    • 838. Push Dominoes
    • 1208. Get Equal Substrings Within Budget
    • 1052. Grumpy Bookstore Owner
    • 1423. Maximum Points You Can Obtain from Cards
    • 1497. Check If Array Pairs Are Divisible by k
    • 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
    • 1456. Maximum Number of Vowels in a Substring of Given Length
    • 1498. Number of Subsequences That Satisfy the Given Sum Condition
    • Sliding window and calculate counts
      • 1477. Find Two Non-overlapping Sub-arrays Each With Target Sum
      • 992. Subarrays with K Different Integers
      • 1248. Count Number of Nice Subarrays
      • 1358. Number of Substrings Containing All Three Characters
  • Topological sorting
    • 366. Find Leaves of Binary Tree
    • 1136. Parallel Courses
    • 269. Alien Dictionary
  • DFS
    • 329. Longest Increasing Path in a Matrix
    • 1055. Shortest Way to Form String
    • 489. Robot Room Cleaner
    • 1706. Where Will the Ball Fall
    • Build a graph before DFS
      • 133. Clone Graph
      • 1519. Number of Nodes in the Sub-Tree With the Same Label
      • 1466. Reorder Routes to Make All Paths Lead to the City Zero
      • 1376. Time Needed to Inform All Employees
      • 1319. Number of Operations to Make Network Connected
      • 1443. Minimum Time to Collect All Apples in a Tree
    • 1110. Delete Nodes And Return Forest
    • 1448. Count Good Nodes in Binary Tree
    • 1339. Maximum Product of Splitted Binary Tree
    • 1367. Linked List in Binary Tree
    • 1145. Binary Tree Coloring Game
    • 1026. Maximum Difference Between Node and Ancestor
    • 1034. Coloring A Border
    • 1123. Lowest Common Ancestor of Deepest Leaves
    • 1302. Deepest Leaves Sum
    • 979. Distribute Coins in Binary Tree
    • 1315. Sum of Nodes with Even-Valued Grandparent
    • 988. Smallest String Starting From Leaf
    • 542. 01 Matrix
    • DFS with return value (DP)
      • 688. Knight Probability in Chessboard
      • 1530. Number of Good Leaf Nodes Pairs
      • 971. Flip Binary Tree To Match Preorder Traversal
    • 841. Keys and Rooms
    • 547. Friend Circles
    • 576. Out of Boundary Paths
    • 1020. Number of Enclaves
    • 1254. Number of Closed Islands
    • 721. Accounts Merge
    • 430. Flatten a Multilevel Doubly Linked List
    • 851. Loud and Rich
    • Color DFS
      • 785. Is Graph Bipartite?
      • 802. Find Eventual Safe States
      • 886. Possible Bipartition
      • 947. Most Stones Removed with Same Row or Column
      • 959. Regions Cut By Slashes
  • BFS
    • 847. Shortest Path Visiting All Nodes
    • 919. Complete Binary Tree Inserter
    • 305. Number of Islands II
    • 743. Network Delay Time
    • 102. Binary Tree Level Order Traversal
    • 515. Find Largest Value in Each Tree Row
  • TreeMap
    • 2007. Find Original Array From Doubled Array
    • 1825. Finding MK Average
    • 1146. Snapshot Array
    • 616. Add Bold Tag in String
    • 732. My Calendar III
    • 715. Range Module
    • 826. Most Profit Assigning Work
    • 436. Find Right Interval
    • 528. Random Pick with Weight
    • 911. Online Election
    • 497. Random Point in Non-overlapping Rectangles
  • Find sub-array
    • 974. Subarray Sums Divisible by K
    • 523. Continuous Subarray Sum
  • Array
    • Range Sum of m*n array
      • 1314. Matrix Block Sum
    • Spiral Matix Series
      • 54. Spiral Matrix
      • 59. Spiral Matrix II
      • 885. Spiral Matrix III
    • 27. Remove Element (1)
    • 26. Remove Duplicates from Sorted Array (1)
    • 80. Remove Duplicates from Sorted Array II (1)
    • 277. Find the Celebrity (1)
    • 189. Rotate Array (1)
    • 41. First Missing Positive (1)
    • 299. Bulls and Cows (1)
    • 134. Gas Station (1)
    • 274. H-Index (1)
    • 275. H-Index II (1)
    • 243. Shortest Word Distance (1)
    • 244. Shortest Word Distance II (1)
    • 245. Shortest Word Distance III (1)
    • 217. Contains Duplicate (1)
    • 55. Jump Game (1)
    • 45. Jump Game II (1)
    • The series of stock problems
      • 714. Best Time to Buy and Sell Stock with Transaction Fee
      • 309. Best Time to Buy and Sell Stock with Cooldown (1)
      • 188. Best Time to Buy and Sell Stock IV (1)
      • 123. Best Time to Buy and Sell Stock III (1)
      • 122. Best Time to Buy and Sell Stock II (1)
      • 121. Best Time to Buy and Sell Stock (1)
    • 42. Trapping Rain Water (1)
    • 135. Candy
    • 833. Find And Replace in String
    • 334. Increasing Triplet Subsequence (1)
    • 128. Longest Consecutive Sequence (1)
      • 1562. Find Latest Group of Size M
    • 164. Maximum Gap (1)
    • 289. Game of Life (1)
    • Intervals
      • 731. My Calendar II
      • 763. Partition Labels
      • 435. Non-overlapping Intervals
      • 56. Merge Intervals (1)
      • 57. Insert Interval (1)
    • 252. Meeting Rooms (1)
    • 253. Meeting Rooms II (1)
    • 352. Data Stream as Disjoint Intervals (1)
    • 295. Find Median from Data Stream (1)
    • 325. Maximum Size Subarray Sum Equals k (1)
    • 238. Product of Array Except Self (1)
    • 152. Maximum Product Subarray (1)
    • 228. Summary Ranges (1)
    • 163. Missing Ranges (1)
    • 75. Sort Colors (1)
    • 283. Move Zeroes (1)
    • 376. Wiggle Subsequence (1)
    • 280. Wiggle Sort
    • 215. Kth Largest Element in an Array (2)
    • (TBD)324. Wiggle Sort II
    • 278. First Bad Version
    • 35. Search Insert Position
    • 81. Search in Rotated Sorted Array II
    • 154. Find Minimum in Rotated Sorted Array II
    • 374. Guess Number Higher or Lower
    • 34. Find First and Last Position of Element in Sorted Array
    • 349. Intersection of Two Arrays
    • 350. Intersection of Two Arrays II
    • 354. Russian Doll Envelopes
    • 84. Largest Rectangle in Histogram
    • 85. Maximal Rectangle
    • 845. Longest Mountain in Array
    • 524. Longest Word in Dictionary through Deleting
  • String
    • 28. Implement strStr()
    • 14. Longest Common Prefix
    • 58. Length of Last Word
    • 387. First Unique Character in a String
    • 383. Ransom Note
    • 344. Reverse String
    • 151. Reverse Words in a String
    • 186. Reverse Words in a String II
    • 345. Reverse Vowels of a String
    • 205. Isomorphic Strings
    • 293. Flip Game
    • 293. Flip Game II
    • 290. Word Pattern
    • 242. Valid Anagram
    • 49. Group Anagrams
    • 249.Group Shifted Strings
    • 87. Scramble String
    • 161.One Edit Distance
    • 38. Count and Say
    • 358. Rearrange String k Distance Apart
    • 316. Remove Duplicate Letters
    • 271.Encode and Decode Strings
    • 168. Excel Sheet Column Title
    • 171. Excel Sheet Column Number
    • 13. Roman to Integer
    • 12. Integer to Roman
    • 273. Integer to English Words
    • 392. Is Subsequence
    • 246. Strobogrammatic Number
    • 247. Strobogrammatic Number II
    • 157.Read N Characters Given Read4
    • 158.Read N Characters Given Read4 II — Call multiple times
    • 68. Text Justification
    • 76. Minimum Window Substring
    • 30. Substring with Concatenation of All Words
    • 159. Longest Substring with At Most Two Distinct Characters
    • 125. Valid Palindrome
    • 266. Palindrome Permutation
    • 9. Palindrome Number
    • 214. Shortest Palindrome
    • 336. Palindrome Pairs
    • 131. Palindrome Partitioning
    • 132. Palindrome Partitioning II
    • 267. Palindrome Permutation II
    • 20. Valid Parentheses
    • 22. Generate Parentheses
    • 32. Longest Valid Parentheses
    • 241. Different Ways to Add Parentheses
    • 301. Remove Invalid Parentheses
    • 115. Distinct Subsequences
    • 516. Longest Palindromic Subsequence
    • 647. Palindromic Substrings
  • Math
    • 7. Reverse Integer
    • 165. Compare Version Numbers
    • 66. Plus One
    • 258. Add Digits
    • 67. Add Binary
    • 43. Multiply Strings
    • 29. Divide Two Integers
    • 69. Sqrt(x)
    • 50. Pow(x, n)
    • 367. Valid Perfect Square
    • 365. Water and Jug Problem
    • 204. Count Primes
    • 1248. Count Number of Nice Subarrays
    • 231. Power of Two
  • Tree
    • 572. Subtree of Another Tree
    • 144. Binary Tree Preorder Traversal
    • 95. Unique Binary Search Trees II
    • 94. Binary Tree Inorder Traversal
    • 145. Binary Tree Postorder Traversal
    • 513. Find Bottom Left Tree Value
    • 100. Same Tree
    • 101. Symmetric Tree
    • 226. Invert Binary Tree
    • 257. Binary Tree Paths
    • 112. Path Sum
    • 113. Path Sum II
    • 437. Path Sum III
    • 129. Sum Root to Leaf Numbers
    • 111. Minimum Depth of Binary Tree
    • 104. Maximum Depth of Binary Tree
    • 110. Balanced Binary Tree
    • 124. Binary Tree Maximum Path Sum
    • 222. Count Complete Tree Nodes
    • 107. Binary Tree Level Order Traversal II
    • 103. Binary Tree Zigzag Level Order Traversal
    • 199. Binary Tree Right Side View
    • 230. Kth Smallest Element in a BST
    • 98. Validate Binary Search Tree
    • 235. Lowest Common Ancestor of a Binary Search Tree
    • 236. Lowest Common Ancestor of a Binary Tree
    • 108. Convert Sorted Array to Binary Search Tree
    • 109. Convert Sorted List to Binary Search Tree
    • 173. Binary Search Tree Iterator
    • 297. Serialize and Deserialize Binary Tree
    • 99. Recover Binary Search Tree
    • 116. Populating Next Right Pointers in Each Node
  • Dynamic programing
    • 375. Guess Number Higher or Lower II
    • 1262. Greatest Sum Divisible by Three
    • 70. Climbing Stairs
    • 343. Integer Break
    • 62. Unique Paths I
    • 91. Decode Ways
    • 363. Max Sum of Rectangle No Larger Than K
    • 10. Regular Expression Matching
    • 44. Wildcard Matching
    • 96. Unique Binary Search Trees
    • 304. Range Sum Query 2D - Immutable
    • 338. Counting Bits
    • 264. Ugly Number II
    • 583. Delete Operation for Two Strings
    • LCS related (Largest/Longest Increasing Sequence)
      • 1626. Best Team With No Conflicts
      • 1143. Longest Common Subsequence
      • 300. Longest Increasing Subsequence
      • 368. Largest Divisible Subset
      • 646. Maximum Length of Pair Chain
  • LinkedList
    • 206. Reverse Linked List (1)
    • 141. Linked List Cycle
    • 92. Reverse Linked List II
    • 160. Intersection of Two Linked Lists
    • 234. Palindrome Linked List
    • 143. Reorder List
    • 142. Linked List Cycle II
    • 148. Sort List
    • 25. Reverse Nodes in k-Group
    • 61. Rotate List
    • 86. Partition List
    • 23. Merge k Sorted Lists
    • 147. Insertion Sort List
    • 146. LRU Cache
  • DFS
    • 200. Number of Islands
    • 130. Surrounded Regions
    • 127. Word Ladder
    • 51. N-Queens
    • 341. Flatten Nested List Iterator
    • 39. Combination Sum
    • 79. Word Search
    • 105. Construct Binary Tree from Preorder and Inorder Traversal
    • 106. Construct Binary Tree from Inorder and Postorder Traversal
    • 114. Flatten Binary Tree to Linked List
    • 207. Course Schedule
    • 529. Minesweeper
  • Random
    • 384. Shuffle an Array
    • 398. Random Pick Index
    • 382. Linked List Random Node
    • 380. Insert Delete GetRandom O(1)
  • Stack & PriorityQueue
    • 225. Implement Stack using Queues
    • 735. Asteroid Collision
    • 155. Min Stack
    • 150. Evaluate Reverse Polish Notation
    • 71. Simplify Path
    • 394. Decode String
    • 224. Basic Calculator
    • 227. Basic Calculator II
    • 385. Mini Parser
    • 84. Largest Rectangle in Histogram
    • 347. Top K Frequent Elements
    • 332. Reconstruct Itinerary
    • 218. The Skyline Problem
    • 739. Daily Temperatures
  • Bit Manipulation
    • 389. Find the Difference
    • 318. Maximum Product of Word Lengths
    • 201. Bitwise AND of Numbers Range
    • 191. Number of 1 Bits
  • Matrix
    • 73. Set Matrix Zeroes
    • 48. Rotate Image
    • 240/74. Search a 2D Matrix II
  • BFS
    • 310. Minimum Height Trees
    • 752. Open the Lock
    • 934. Shortest Bridge
    • 417. Pacific Atlantic Water Flow
  • Others
    • 710. Random Pick with Blacklist
    • 621. Task Scheduler
    • 767. Reorganize String
    • 923. 3Sum With Multiplicity
    • 978. Longest Turbulent Subarray
    • 16. 3Sum Closest
    • 898. Bitwise ORs of Subarrays
Powered by GitBook
On this page

Was this helpful?

  1. Dynamic Programing

Game theory

486. Predict the Winner464. Can I Win
Previous1024. Video StitchingNext486. Predict the Winner

Was this helpful?