LeetCode 1851: Minimum Interval To Include Each Query — Step-by-Step Visual Trace
Medium — Heap | Sorting | Array | Greedy
The Problem
Given a list of intervals and queries, find the minimum length interval that contains each query point, returning -1 if no interval contains the query.
Approach
Sort intervals by start time and que...
blog.tracelit.dev1 min read