排序後處理 Sort then Scan
48 題(0 題以此為主技法)
🎯 何時用
先排序能讓貪心、雙指針、掃描變得簡單(區間、配對、相鄰關係)。
🧩 模板心法
依關鍵字排序後一次掃描;常與貪心或雙指針搭配。注意排序鍵與穩定性。
Easy 7 題
Medium 35 題
- #153Sum
- #49Group Anagrams
- #56Merge Intervals
- #253Meeting Rooms II
- #435Non-overlapping Intervals
- #75Sort Colors
- #148Sort List
- #215Kth Largest Element in an Array
- #912Sort an Array
- #973K Closest Points to Origin
- #184Sum
- #40Combination Sum II
- #47Permutations II
- #90Subsets II
- #147Insertion Sort List
- #179Largest Number
- #280Wiggle Sort
- #646Maximum Length of Pair Chain
- #658Find K Closest Elements
- #846Hand of Straights
- #853Car Fleet
- #881Boats to Save People
- #1029Two City Scheduling
- #1268Search Suggestions System
- #1288Remove Covered Intervals
- #1498Number of Subsequences That Satisfy The Given Sum Condition
- #1626Best Team with no Conflicts
- #1647Minimum Deletions to Make Character Frequencies Unique
- #1834Single Threaded CPU
- #1838Frequency of The Most Frequent Element
- #1921Eliminate Maximum Number of Monsters
- #1968Array With Elements Not Equal to Average of Neighbors
- #1985Find the Kth Largest Integer in the Array
- #2300Successful Pairs of Spells and Potions
- #2542Maximum Subsequence Score