Lam Research Interview Question

Sort k nearest neighbours in an array