Day6/day6.2.py
def tick(nums):
    """
    Simulate one tick of passage of time
    nums is a frequency dict of all fish counted by their timer count
    """
    new_nums = {}
    for k, v in nums.items():
        if k == 0:
            new_nums[6] = new_nums.get(6, 0) + v
            new_nums[8] = new_nums.get(8, 0) + v
            continue
        new_nums[k - 1] = new_nums.get(k - 1, 0) + v
    return new_nums

    Simulate one tick of passage of time
    nums is a frequency dict of all fish counted by their timer count
    
Simulate one tick of passage of time
nums is a frequency dict of all fish counted by their timer count
Simulate one tick of passage of time nums is a frequency dict of all fish counted by their timer count
def tick(nums):
    new_nums = {}
    for k, v in nums.items():
        if k == 0:
            new_nums[6] = new_nums.get(6, 0) + v
            new_nums[8] = new_nums.get(8, 0) + v
            continue
        new_nums[k - 1] = new_nums.get(k - 1, 0) + v
    return new_nums
def tick ( nums ) : new_nums = { } for k , v in nums . items ( ) : if k == 0 : new_nums [ 6 ] = new_nums . get ( 6 , 0 ) + v new_nums [ 8 ] = new_nums . get ( 8 , 0 ) + v continue new_nums [ k - 1 ] = new_nums . get ( k - 1 , 0 ) + v return new_nums
Simulate one tick of passage of time
nums is a frequency dict of all fish counted by their timer count
Simulate one tick of passage of time nums is a frequency dict of all fish counted by their timer count
"""
    Simulate one tick of passage of time
    nums is a frequency dict of all fish counted by their timer count
    """
nums