Merge K Sorted Linked Lists - Leetcode 23

preview_player
Показать описание
leetcode, coding interview question, data structures, data structures and algorithms, faang
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

I mean this question looks very idiotic imo.
Obviously the solution would be to use priority queue but don’t you think why to have so much effort? We can get the answer in O(N) where N= sum of all elements.
You would ask how?
Basically we do offline heapify of all the elements and get the priority queue in O(N). Now simply pop in O(1)😅

hit
Автор

You put 2 dashes while the third dash is supposed to be the number 1. That's confusing af.

PaulSebastianM
Автор

What "all of these elements"? 😕

PaulSebastianM
Автор

Don’t you think it’s the easiest problem on lt?

janfraczak
Автор

Can’t you create a new list containing all the lists and sort it with sort function?

kevinitaliya