LeetCode 791: Custom Sort String
A clear explanation of rearranging a string so that selected characters follow a custom order.
9 notes
A clear explanation of rearranging a string so that selected characters follow a custom order.
A clear explanation of the H-Index problem using sorting, then an optimized counting approach.
Count key frequencies in parallel, compute prefix sums, then scatter elements into sorted positions.
Counting sort variant that stores counts only for keys that appear, avoiding dense arrays over large key ranges.
Extend counting sort to handle negative integers by shifting keys into a nonnegative index range.
Sort integers by counting occurrences of each key and reconstructing the output in linear time.
Counting-based stable sorting technique that maps keys to index ranges using frequency and prefix sums.
Stable variant of counting sort using prefix sums to preserve relative order of equal keys.
Sort integer keys from a small range in linear time by counting occurrences and reconstructing the output from those counts.