from typing import List
import heapq


def kNN(distances: List[float], k: int):
    """
    Computes k-nearest-neighbors.

    :param distances: A collection of distances from some point of interest.
    :param k: The number of neighbors to average over.
    :return: The mean of the smallest 'k' values in 'distances'.
    """
    return sum(heapq.nsmallest(k, distances))/k