merge k sorted lists (resolved)