数组
Data Structures & Algorithms · 65 notes
- Best Time to Buy and Sell Stock with Cooldownhistorical
LeetCode notes on the Best Time to Buy and Sell Stock with Cooldown problem.
- Longest Increasing Subsequencehistorical
LeetCode notes on the Longest Increasing Subsequence problem.
- Find All Numbers Disappeared in an Arrayhistorical
LeetCode notes on finding all disappeared numbers in an array.
- Find First and Last Position of Element in Sorted Arrayhistorical
LeetCode notes on finding the first and last position of an element in a sorted array.
- Find First and Last Position of Element in Sorted Arrayhistorical
LeetCode notes on finding the first and last position of an element in a sorted array.
- Find the K-th Largesthistorical
Find the K-th largest element in an array using sorting or quicksort partitioning.
- Binary Searchhistorical
Use binary search to find a target value in a sorted ascending integer array.
- Find Minimum in Rotated Sorted Arrayhistorical
LeetCode notes on finding the minimum in a rotated sorted array.
- Find Smallest Letter Greater Than Targethistorical
Find the smallest letter greater than the target in a cyclically ordered character list.
- Queue Reconstruction by Heighthistorical
Sort first and then insert by position to reconstruct a queue described by height and preceding-person counts.
- Largest Numberhistorical
Rearrange non-negative integers so their concatenation forms the largest integer.
- Top K Frequent Elementshistorical
Find the top K frequent elements using frequency counting with sorting or a min-heap.
- Move Zeroeshistorical
Move all zeroes to the end of the array while preserving the relative order of non-zero elements.
- Product of Array Except Selfhistorical
Compute the product of array elements except self using left and right product arrays.
- Sort Colorshistorical
Sort 0, 1, and 2 in place using quicksort, bucket sort, or the move-zeroes idea.
- Search a 2D Matrixhistorical
Search a matrix whose rows and columns are both sorted, starting from the top-right corner.
- Subarray Sum Equals Khistorical
LeetCode notes on the brute-force solution for Subarray Sum Equals K.
- Daily Temperatureshistorical
LeetCode notes on Daily Temperatures with brute force and a monotonic stack.
- Sliding Window Maximumhistorical
LeetCode notes on Sliding Window Maximum using brute force, a priority queue, and a monotonic deque.
- Min Stackhistorical
LeetCode notes on implementing a stack that retrieves the minimum element in constant time.
- Median of Two Sorted Arrayshistorical
LeetCode notes on finding the median of two sorted arrays by merging them.
- Shortest Unsorted Continuous Subarrayhistorical
LeetCode notes on finding the shortest continuous subarray that must be sorted.
- Best Time to Buy and Sell Stockhistorical
LeetCode notes on maximizing profit from one stock transaction.