Amazon interview question

top k minimum distances in array