Meta Interview Question

Top k, solved using quick select