input: 
  def kmeans(k: int, data: np.ndarray) -> tuple: 
      """
      Perform k-means clustering on data.
      
      >>> kmeans(3, np.array([[1.0, 2.0], [2.0, 3.0], [3.0, 4.0], [8.0, 9.0], [9.0, 10.0], [10.0, 11.0]]))
      (array([0, 0, 0, 1, 1, 1]), array([[2. , 3.5], [9. , 10. ]]))
      >>> kmeans(2, np.array([[1.0, 1.0], [2.0, 2.0], [10.0, 10.0], [11.0, 11.0]]))
      (array([0, 0, 1, 1]), array([[1.5, 1.5], [10.5, 10.5]]))
      """
  
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