Beispiel #1
0
        static void Main()
        {
            string[]    input       = File.ReadAllLines("Day7\\Input\\input.txt");
            List <Node> singleNodes = Part1.ParseLeafs(input);
            List <Node> treeSchema  = Part1.ParseChildren(input, singleNodes);
            Node        root        = treeSchema.Find(node => node.parent == null);

            int  imbalance = 0;
            Node badNode   = FindImbalance(root, 0, out imbalance);

            Console.WriteLine("Node " + badNode.name + " (" + badNode.weight + ")" + " needs to be adjusted " + imbalance);
            Console.ReadLine();
        }
Beispiel #2
0
 private static long GetMaxPermutationValue(HashSet <byte> numbers) => Part1.Permute(numbers).Select(EvaluateOutputSignalSerial).Max();