Smallest Range Covering Elements From K Lists
Given k sorted lists, find the smallest range [a, b] that contains at least one number from each list. A range [a, b] is smaller than [c, d] if b - a < d - c, or a < c when the lengths tie. Print a and b.
Constraints
1 <= k <= 3500 -10^5 <= value <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.