Example #1
0
        public int Solution(string input)
        {
            Dictionary <string, string>       instructions = instructionsRepository.GetInstructions(input);
            SortedDictionary <string, ushort> wireSignals  = this.wireSignals.CalculateWireSignals(instructions);

            wireSignals.TryGetValue("a", out ushort wireA);
            instructions["b"] = $"{wireA} -> b";

            wireSignals = this.wireSignals.CalculateWireSignals(instructions);
            wireSignals.TryGetValue("a", out wireA);

            return(wireA);
        }
Example #2
0
 public Part2()
 {
     instructionsRepository = new InstructionsRepository();
     wireSignals            = new WireSignals();
 }