15. 3Sum
16. 3Sum Closest
18. 4Sum
259. 3Sum Smaller\
3. Longest Substring Without Repeating Characters
76. Minimum Window Substring
159. Longest Substring with At Most Two Distinct Characters
340. Longest Substring with At Most K Distinct Characters
424.Longest Repeating Character Replacement
611. Valid Triangle Number
992. Subarrays with K Different Integers
1004.Max Consecutive Ones III
1358.Number of Substrings Containing All Three Characters
1052.Grumpy Bookstore Owner
1838. Frequency of the Most Frequent Element
2024.Maximize the Confusion of an Exam
2537. Count the Number of Good Subarrays
2411. Smallest Subarrays With Maximum Bitwise OR
2461. Maximum Sum of Distinct Subarrays With Length K
2747. Count Zero Request Servers
2831.Find the Longest Equal Subarray
986. Interval List Intersections
1537. Get the Maximum Score
1775. Equal Sum Arrays With Minimum Number of Operations
個人認為比較不像其他two pointers題目,特別是指針擺法跟移動方向,可能會融合greedy想法,才會知道指針怎麼擺
525.Contiguous Array
930.Binary Subarrays With Sum
974.Subarray Sums Divisible by K
1371.Find the Longest Substring Containing Vowels in Even Counts
1442.Count Triplets That Can Form Two Arrays of Equal XOR
1524.Number of Sub-arrays With Odd Sum
1542.Find Longest Awesome Substring
1590.Make Sum Divisible by P
1915.Number of Wonderful Substrings
1983.Widest Pair of Indices With Equal Range Sum
2025.Maximum Number of Ways to Partition an Array
2488.Count Subarrays With Median K
2489.Number of Substrings With Fixed Ratio
2845.Count of Interesting Subarrays
2875.Minimum Size Subarray in Infinite Array
435.Non-overlapping-Intervals
1288. Remove Covered Intervals\
435.Non-overlapping-Intervals
881. Boats to Save People
3776. Minimum Moves to Balance Circular Array\
55. Jump Game
45. Jump Game II
134. Gas Station
605. Can Place Flowers
135. Candy\
334.Increasing Triplet Subsequence
689.Maximum Sum of 3 Non-Overlapping Subarrays
1525.Number of Good Ways to Split a String
1653.Minimum Deletions to Make String Balanced
1664.Ways to Make a Fair Array
1671.Minimum Number of Removals to Make Mountain Array
1769.Minimum Number of Operations to Move All Balls to Each Box
1888.Minimum Number of Flips to Make the Binary String Alternating
2163.Minimum Difference in Sums After Removal of Elements
2555.Maximize Win From Two Segments
2874.Maximum Value of an Ordered Triplet II
3789. Minimum Cost to Acquire Required Items\
經典題 703. Kth Largest Element in a Stream
經典題 1046. Last Stone Weight
經典題 215. Kth Largest Element in an Array
973. K Closest Points to Origin
355. Design Twitter\
767. Reorganize String
621. Task Scheduler\
34. Find First and Last Position of Element in Sorted Array
81.Search in Rotated Sorted Array II
302. Smallest Rectangle Enclosing Black Pixels
1482.Minimum-Number-of-Days-to-Make-m-Bouquets
1631.Path-With-Minimum-Effort
1870.Minimum Speed to Arrive on Time\
2226.Maximum-Candies-Allocated-to-K-Children
2563. Count the Number of Fair Pairs
1533. Find the Index of the Large Integer
300. Longest Increasing Subsequence\
-
Iterative Binary Search
2300. Successful Pairs of Spells and Potions
436. Find Right Interval\ -
Binary Lifting
1483. Kth Ancestor of a Tree Node
3559. Number of Ways to Assign Edge Weights II\ -
Binary Search by Value
3639. Minimum Time to Activate String
3048. Earliest Second to Mark Indices I
1802. Maximum Value at a Given Index in a Bounded Array\ -
Find K-th Element
215.Kth-Largest-Element-in-an-Array
373.Find-K-Pairs-with-Smallest-Sums
378.Kth-Smallest-Element-in-a-Sorted-Matrix
786.K-th Smallest-Prime-Fraction
1439.Find-the-Kth-Smallest-Sum-of-a-Matrix-With-Sorted-Rows
1918.Kth-Smallest-Subarray-Sum
2040.Kth-Smallest-Product-of-Two-Sorted-Arrays
668. Kth Smallest Number in Multiplication Table
1539. Kth Missing Positive Number
719. Find K-th Smallest Pair Distance\
112. Path Sum
114. Flatten Binary Tree to Linked List
173. Binary Search Tree Iterator
222. Count Complete Tree Nodes
270. Closest Binary Search Tree Value
272. Closest Binary Search Tree Value II
285. Inorder Successor in BST
298. Binary Tree Longest Consecutive Sequence
437. Path Sum III
549. Binary Tree Longest Consecutive Sequence II
655. Print Binary Tree
897. Increasing Order Search Tree
1660. Correct a Binary Tree
2445. Number of Nodes With Value One
2277. Closest Node to Path in Tree
105. Construct Binary Tree from Preorder and Inorder Traversal
106. Construct Binary Tree from Inorder and Postorder Traversal\
124. Binary Tree Maximum Path Sum
543. Diameter of Binary Tree
687. Longest Univalue Path
1522. Diameter of N-Ary Tree
2049. Count Nodes With the Highest Score
2246. Longest Path With Different Adjacent Characters
235. Lowest Common Ancestor of a Binary Search Tree
經典題 236. Lowest Common Ancestor of a Binary Tree
1644. Lowest Common Ancestor of a Binary Tree II
1650. Lowest Common Ancestor of a Binary Tree III
1676. Lowest Common Ancestor of a Binary Tree IV
1740. Find Distance in a Binary Tree
2096. Step-By-Step Directions From a Binary Tree Node to Another
2509. Cycle Length Queries in a Tree\
90%的Tree題目都是用recursion
834. Sum of Distances in Tree
3786. Total Sum of Interaction Cost in Tree Groups\
127.Word-Ladder
785.Is Graph Bipartite?
1162.As Far from Land as Possible
2812. Find the Safest Path in a Grid\
- Topological Sort
1462.Course Schedule IV
1136. Parallel Courses\
37.Sudoku Solver
46. Permutations
78. Subsets
473.Matchsticks to Square
491.Non-decreasing Subsequences
698.Partition to K Equal Sum Subsets
1306.Jump Game III
2597.The Number of Beautiful Subsets
-
Dijkstra
經典題 743.Network Delay Time
1334.Find the City With the Smallest Number of Neighbors at a Threshold Distance -
Minimum Spanning Tree 1584. Min Cost to Connect All Points\
經典題 496.Next Greater Element I
經典題 503.Next Greater Element II
經典題 739. Daily Temperatures
42.Trapping Rain Water
84.Largest Rectangle in Histogram
85.Maximal Rectangle
768.Max Chunks To Make Sorted II
901.Online Stock Span
907.Sum of Subarray Minimums
962.Maximum Width Ramp
1063.Number of Valid Subarrays
1124.Longest Well-Performing Interval
1856.Maximum Subarray Min-Product
2104.Sum of Subarray Ranges
2334.Subarray With Elements Greater Than Varying Threshold
2355.Maximum Number of Books You Can Take
2434.Using a Robot to Print the Lexicographically Smallest String
2454.Next Greater Element IV
2866.Beautiful Towers II
323. Number of Connected Components in an Undirected Graph
684.Redundant Connection
1489.Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree
2867.Count Valid Paths in a Tree
思考模式: 狀態設計 + 最後一步思維(一個大問題的最優解,必然是由更小子問題的最優解 + 某個「最後一步」組成)\
198. House Robber
213. House Robber II
123. Best Time to Buy and Sell Stock III
309. Best Time to Buy and Sell Stock with Cooldown
376. Wiggle Subsequence
256. Paint House
2036. Maximum Alternating Subarray Sum\
368. Largest Divisible Subset
1235. Maximum Profit in Job Scheduling\
經典題 72. Edit Distance
583. Delete Operation for Two Strings
727. Minimum Window Subsequence\
1278. Palindrome Partitioning III
813. Largest Sum of Averages
410. Split Array Largest Sum
903. Valid Permutations for DI Sequence
2547. Minimum Cost to Split an Array
2472. Maximum Number of Non-overlapping Palindrome Substrings\
經典題 131. Palindrome Partitioning
516. Longest Palindromic Subsequence
312. Burst Balloons
375. Guess Number Higher or Lower II
1246. Palindrome Removal\
1839. Longest Substring Of All Vowels in Order
經典題 494. Target Sum
879. Profitable Schemes
956. Tallest Billboard
474. Ones and Zeroes
經典題 691. Stickers to Spell Word
經典題 1125. Smallest Sufficient Team\
2355.Maximum Number of Books You Can Take\
239. Sliding Window Maximum
480.Sliding-Window-Median\
經典題 252. Meeting Rooms
經典題 253. Meeting Rooms II
經典題 56. Merge Intervals
經典題 57. Insert Interval
732. My Calendar III
759. Employee Free Time
218. The Skyline Problem
2158. Amount of New Area Painted Each Day\
經典題 370. Range Addition
經典題 1109. Corporate Flight Bookings
1094. Car Pooling
1871. Jump Game VII
850. Rectangle Area II
2132 Stamping the Grid\
41. First Missing Positive
442. Find All Duplicates in an Array\
146. LRU Cache
430. Flatten a Multilevel Doubly Linked List\
204. Count Primes
326. Power of Three
263. Ugly Number
202. Happy Number
264. Ugly Number II
1998. GCD Sort of an Array
172. Factorial Trailing Zeroes\