2018/08.py
def part1() -> int:
    """
    Part 1 requires you to sum all of the metadata objects. I do this with the recursive
    traverse_sum function.
    """

    def traverse_sum(node):
        """
        Compute the sum of a given node by summing all of all of the metadata values and
        adding the sum of all of the recursive calls to traverse_sum for all of the
        child nodes.
        """
        return sum(node[1]) + sum(map(traverse_sum, node[0]))

    return traverse_sum(TREE)

    Part 1 requires you to sum all of the metadata objects. I do this with the recursive
    traverse_sum function.
    
Part 1 requires you to sum all of the metadata objects. I do this with the recursive
traverse_sum function.
Part 1 requires you to sum all of the metadata objects . I do this with the recursive traverse_sum function .
def part1() -> int:
    def traverse_sum(node):
        return sum(node[1]) + sum(map(traverse_sum, node[0]))
    return traverse_sum(TREE)
def part1 ( ) -> int : def traverse_sum ( node ) : """
        Compute the sum of a given node by summing all of all of the metadata values and
        adding the sum of all of the recursive calls to traverse_sum for all of the
        child nodes.
        """ return sum ( node [ 1 ] ) + sum ( map ( traverse_sum , node [ 0 ] ) ) return traverse_sum ( TREE )
Part 1 requires you to sum all of the metadata objects.
Part 1 requires you to sum all of the metadata objects .
"""
    Part 1 requires you to sum all of the metadata objects. I do this with the recursive
    traverse_sum function.
    """ """
        Compute the sum of a given node by summing all of all of the metadata values and
        adding the sum of all of the recursive calls to traverse_sum for all of the
        child nodes.
        """