Two Sigma Interview Question

K-selection problem