TuSimple Interview Question

implement K means algorithm