Array
LeetCode array problems in Golang, grouped by difficulty — with the core pattern called out for each.
Easy 10
- Best Time to Buy and Sell StockGreedy
- Flood FillDFS
- Kth Largest Element in a StreamHeap
- Maximum Average Subarray ISliding window
- Meeting RoomsSorting
- Merge Sorted ArraysTwo pointers
- Min Cost Climbing StairsDynamic programming
- Remove Duplicates from Sorted ArrayTwo pointers
- Remove ElementTwo pointers
- Two SumHashing
Medium 28
- Best Time to Buy and Sell Stock IIGreedy
- Capacity To Ship Packages Within D DaysBinary search
- Coin ChangeDynamic programming
- Container With Most WaterTwo pointers
- Find the Smallest Divisor Given a ThresholdBinary search
- Group AnagramsHashing
- House RobberDynamic programming
- Insert IntervalSorting
- Jump GameGreedy
- Jump Game IIGreedy
- Koko Eating BananasBinary search
- Longest Consecutive SequenceHashing
- Longest Increasing SubsequenceDynamic programming
- Longest Substring Without Repeating CharactersSliding window
- Maximum SubarrayDynamic programming
- Meeting Rooms IISorting + heap
- Merge IntervalsSorting
- Minimum Size Subarray SumSliding window
- Next PermutationTwo pointers
- Non-overlapping IntervalsGreedy
- Number of IslandsDFS
- Product of Array Except SelfPrefix products
- Random Pick IndexReservoir sampling
- Remove Duplicates from Sorted Array IITwo pointers
- Remove Stones to Minimize the TotalHeap
- Sort ColorsTwo pointers
- Top K Frequent ElementsHash map + heap
- Valid Triangle NumberTwo pointers
Hard 3
- Making A Large IslandDFS
- Maximum Profit in Job SchedulingDP + binary search
- Trapping Rain WaterTwo pointers
