Pergunta de entrevista da empresa Twin Health

Merge k sorted Array lists

Resposta da entrevista

Sigiloso

3 de ago. de 2022

I solved it using priority queue. Added all the elements from list to minHeap priority queue and then added them one by one to the result list. For this the Runtime : O(n*mlog(n*m)) and Space complexity : O(n*m). Expected Runtime : O(n Log k)