def subset_answer_choices(answer):
    """
    If a user changes their answers multiple times, an iOS device will have redundant answers at the beginning
    and end of the list, so we remove them.
    Args:
        answer(list):
            List of changed answers

    Returns:
        answer(list):
            List of changed answers with redundant answers removed
    """
    if isinstance(answer[0], float):
        answer = answer[1:]

    if len(answer) > 1:
        if answer[-1] == answer[-2]:
            answer = answer[:-1]

    return answer