def renumerate(sequence):
    """
    Reverse emumerate - starts at the highest index (last item in the iterator) and counts down. This generator yields
    a tuple containing the index and item, starting with the last item in the iterator.

    Don't use reversed(list(enumerate(sequence))) as it's not efficient (it has to iterate through the whole sequence first.)

    :param sequence:
    :return:
    """
    for i in range(len(sequence) - 1, -1, -1):
        yield i, sequence[i]
