from typing import Counter


def get_pred(y: list, results: list) -> list:
    """
    Get most common label from nearest neighbour list
    """
    y_pred = []
    for i, r in enumerate(results):
        y_pred.append(Counter(y[r]).most_common(1)[0][0])
    return y_pred