k-means assignment

Write codeMedium22 minMeta and Spotify style

Your task

Perform a single k-means assignment step. Given a list of data points (each a list of floats) and a list of current centroids (same dimensionality), return a list of integers where the i-th entry is the index of the centroid nearest to point i by squared Euclidean distance. There is at least one centroid. Break ties by choosing the lowest centroid index.

Examples

assign_clusters(points: list[list[float]], centroids: list[list[float]]) -> list[int]
Example 1
Inputassign_clusters([[0, 0], [10, 10]], [[0, 0], [10, 10]])
Output[0, 1]