def t02_calc_population(base_population) -> int:
    """
    Gets a starting population of fish as input and determines their number after an 256 days period.
    Each element in the starting population represents a fish and each element's value represents the
    reproduction timer.
    Also uses a better storage management to overcome O(log(n)) as runtime.

    :param base_population: Array with information about the starting population.
    :return: The number of fish in the population
    """
    arr = [0 for i in range(9)]
    for i in base_population:
        arr[i] += 1

    for i in range(256):
        births = arr.pop(0)
        arr.append(births)
        arr[6] += births
    return sum(arr)