from typing import List


def average_recall_at_k(relevant_items: List, recommendation: List, k: int = 10):
    """
    Calculate the average recall at k (AR@K) of items in a ranked list.

    Args:
        relevant_items (array-like): An N x 1 array of relevant items.
        recommendation (array-like):  An N x 1 array of items.
        k (int): the number of items considered in the predicted list.
    Returns:
        AR@K (float): The average precision @ k of a predicted list.
    """
    if len(recommendation) > k:
        recommendation = recommendation[:k]

    num_hits = 0.0
    score = 0.0

    for i, item in enumerate(recommendation):
        if item in relevant_items and item not in recommendation[:i]:
            num_hits += 1.0
            score += num_hits / (i + 1.0)

    return score / len(relevant_items)