def recall_at_k(y_true, y_pred, k=None):
    """Recall at K.
    
    Args:
        y_true (list or np.array): True values.
        y_pred (list or np.array): Predicted values.
        k (int): Limit of predicted values.
    
    Returns:
        float: recall at k (max=1, min=0)
    
    Examples:
        >>> y_true = [5,1,0,7,2]
        >>> y_pred = [2,5,0,1,7]
        >>> recall_at_k(y_true, y_pred, k=3)
        0.6
        >>> y_true = np.array([5,1,0,7,2])
        >>> y_pred = np.array([9,0,8,1,7])
        >>> recall_at_k(y_true, y_pred, k=3)
        0.2

    """
    predictions = y_pred[:k]
    num_hit = len(set(predictions).intersection(set(y_true)))
    return float(num_hit) / len(y_true)