dsa2 min read
Insert Interval [Medium] — Sweep and Merge
Insert a new interval into a sorted non-overlapping list and merge any overlaps in a single sweep.
Read →
webcoderspeed.com
1276 articles
Insert a new interval into a sorted non-overlapping list and merge any overlaps in a single sweep.
Find the minimum number of intervals to remove so the rest are non-overlapping, using a greedy earliest-end-time strategy.
Find all unique combinations that sum to a target, using backtracking with candidate reuse allowed.
Generate all permutations of distinct integers using in-place swap backtracking.
Generate the power set of distinct integers using backtracking or bitmask enumeration.