Meta Interview Question

Min heap and sorting problem