Pergunta de entrevista da empresa Amazon

Given n arrays of k elements (not necessarily sorted), merge them into a sorted array.