/// <summary> /// https://adventofcode.com/2020/day/14#part2 /// </summary> public static void Part2() { var computer = new SeaPortComputer(); var program = SeaPortProgram.Parse(Input.Get(14)); computer.Run(program, true); Console.WriteLine(Sum(computer)); }
public static BigInteger Sum(SeaPortComputer computer) { return(computer.Memory.Aggregate(BigInteger.Zero, (x, y) => x + y.Value)); }