input: def kmeans(k: int, data: np.ndarray) -> tuple:
      """
      Perform k-means clustering on data
      
      >>> kmeans(2, np.array([[1.0], [2.0], [10.0], [11.0]]))
      (array([0., 0., 1., 1.]), array([[1.5], [10.5]]))
      >>> kmeans(3, np.array([[1.0, 2.0], [10.0, 11.0], [100.0, 101.0], [110.0, 111.0], [120.0, 121.0]]))
      (array([0., 0., 1., 1., 2.]), array([[3.75, 6.75], [90.0, 90.0], [116.0, 116.0]]))
      """
output:     np.random.seed(42)
      centroids = data[np.random.choice(data.shape[0], k, replace=False)]
      
      while True:
          labels = np.argmin(np.linalg.norm(data[:, np.newaxis] - centroids, axis=2), axis=1)
          new_centroids = np.array([data[labels == i].mean(axis=0) for i in range(k)])
          
          if np.all(centroids == new_centroids):
              break
          
          centroids = new_centroids
      
      return labels, centroids