Mobileye Interview Question

Write a function that takes an array of vectors 'n,' a distance function, and an integer 'K.' The function should cluster the vectors into 'K' groups based on the minimum distance."