Centroid-Based Data Partitioning - Coding problem | OneNoughtOne