input: from typing import List, Tuple
  import numpy as np
  
  def kmeans(k: int, data: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: 
      """
      Perform k-means clustering on data
      >>> kmeans(2, np.array([[1, 1], [2, 2], [4, 4], [5, 5]]))
      (array([0, 0, 1, 1]), array([[1.5, 1.5], [4.5, 4.5]]))
      """
      centroids = data[np.random.randint(low=0, high=len(data), size=k)]
      prev_centroids = np.zeros(centroids.shape)
  
      clusters = np.zeros(len(data))
      distances = np.zeros((len(data), k))
      
      while not np.allclose(centroids, prev_centroids):
          prev_centroids = centroids
      
          for idx, centroid in enumerate(centroids):
              distances[:, idx] = np.linalg.norm(data - centroid, axis=1)
      
          clusters = np.argmin(distances, axis=1)
      
          for idx in range(k):
              centroids[idx] = np.mean(data[clusters == idx], axis=0)
      
      return clusters, centroids
output:     centroids = data[np.random.randint(low=0, high=len(data), size=k)]
      prev_centroids = np.zeros(centroids.shape)
  
      clusters = np.zeros(len(data))
      distances = np.zeros((len(data), k))
      
      while not np.allclose(centroids, prev_centroids):
          prev_centroids = centroids
      
          for idx, centroid in enumerate(centroids):
              distances[:, idx] = np.linalg.norm(data - centroid, axis=1)
      
          clusters = np.argmin(distances, axis=1)
      
          for idx in range(k):
              centroids[idx] = np.mean(data[clusters == idx], axis=0)
      
      return clusters, centroids