NumPy allowed · plain Python earns 10 bonus points
Implement the silhouette score -- the standard way to numerically evaluate a clustering (like K-Means' output) WITHOUT ground-truth labels, by checking whether every point is closer to its own cluster than to the nearest other one.
Implement silhouette_score(X, labels): for every point, compute its mean in-cluster distance a(i) and its mean distance to the nearest other cluster b(i), combine them into s(i) = (b-a)/max(a,b), and return the mean s(i) across all points.
silhouette_score(X: list[list[float]], labels: list[int]) -> float