Sign In
You are coding as a Guest. Sign in with Google in 1 tap to save your daily streak, lock in +50 XP & boost your college rank!
Save Streak (1-Tap Google)
9:00 AM Daily Incident ReleaseMaintaining a 7-day streak grants a 2.5× Recruiter Visibility Multiplier on the Recruiter Talent Radar.
Multiplier Ladder:1d: 1.0ו3d: 1.5ו7d: 2.5× MAX
🔥Merge k Sorted Lists: Min-Heap MultiplexerHard
SUPER HARD PROBLEM OF THE DAY+150 XP • FAANG OA TIER

High-difficulty challenge matching authentic Google, Amazon & Uber L5 online assessment conditions.

HardTrees & Graphs•Acceptance: 51.4%

Merge k Sorted Lists: Min-Heap Multiplexer

Targeted in FAANG & Tech OA:AmazonGoogleUber
Real-World Engineering Context
Core to distributed log aggregation systems (Loki, Elasticsearch, Kafka) at Swiggy and Uber, where time-sorted log shards from k microservices are multiplexed in real-time.
You are given an array of `k` sorted integer arrays `lists`. Merge all the sorted arrays into one single sorted array and return it. Analyze and describe its complexity.

Sample Test Cases

Input: [[[1,4,5],[1,3,4],[2,6]]]
Expected: [1,1,2,3,4,4,5,6]
Input: [[]]
Expected: []
Input: [[[2,3,7]]]
Expected: [2,3,7]

Constraints

  • k == lists.length
  • 0 <= k <= 10^4
  • 0 <= lists[i].length <= 500
  • -10^4 <= lists[i][j] <= 10^4
  • lists[i] is sorted in ascending order.
  • The sum of lists[i].length will not exceed 10^4.
Verified Proof-of-Work ATS PortfolioCryptographic Verification
Export tamper-proof problem verifications to your direct ATS applications
DevScore: Unranked (0/1000)

Every verified problem solve writes authentic cryptographic proof-of-work to your profile. Attach your verified DevScore badge to ATS applications to stand out to engineering hiring teams across 4,000+ verified live tech openings (23,000+ cumulative audited) on RoleNest.

Explore 4,000+ Direct ATS Openings on RoleNest ↗Solve Challenge to Activate Ledger