Pinterest interview question

Sort 2d array and return top k elements