from typing import Iterable
from functools import reduce


def _digits_to_number(digits: Iterable[int]) -> int:
    """ Gives the number given by its digits, e.g. [1, 2, 3] -> 123 """
    return reduce(lambda x, y: x * 10 + y, digits)