leetle

Daily challenge for 2026-06-30

546. Merge Contiguous Blocks

Given a list of intervals representing blocks of allocated memory, merge all overlapping or contiguous blocks into a single list of disjoint blocks. Two blocks are contiguous if the end of one is exactly equal to the start of the next.

Example:
Input: blocks = [[1, 3], [3, 5], [8, 10], [10, 12]]
Output: [[1, 5], [8, 12]]

Run this challenge interactively in Python or JavaScript when the app loads.