def get_optimal_action(bandit):
    """
    Returns the best action of a bandit.

    Args:
        bandit (list): Contains mean and std / reward for each k.

    Returns:
        int: Index of best action
    """
    max_R = [sum(x) if isinstance(x, tuple) else x for x in bandit]
    return max_R.index(max(max_R))