Pregunta de entrevista de Twin Health

Merge k sorted Array lists

Respuesta de la entrevista

Anónimo

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)