diff --git a/Days/Day10.cs b/Days/Day10.cs new file mode 100644 index 0000000..9c1262d --- /dev/null +++ b/Days/Day10.cs @@ -0,0 +1,282 @@ +using Spectre.Console; + +namespace AdventOfCode.Days; + +public class Day10 : Day +{ + public override int Number => 10; + public override string Name => "Factory"; + + public override void RunPart1(bool display = true) + { + var totalButtonPresses = 0; + + // Parse data + Span lightsTargetBuffer = stackalloc bool[10]; + + Span> buttonsBuffer = new List[20]; + for (var i = 0; i < buttonsBuffer.Length; i++) + { + buttonsBuffer[i] = new List(10); + } + + // Simulation data + var stepsToSimulate = new Queue(); + + foreach (var line in Input.EnumerateLines()) + { + stepsToSimulate.Clear(); + + // Parse line input data + var remainingLine = line[1..]; // Skip first square bracket + + // Parse indicator lights + var indicatorLightsEndIndex = remainingLine.IndexOf(']'); + var indicatorLightsSpan = remainingLine[..indicatorLightsEndIndex]; + + lightsTargetBuffer.Fill(false); + + for (var i = 0; i < indicatorLightsSpan.Length; i++) + { + lightsTargetBuffer[i] = indicatorLightsSpan[i] is '#'; + } + + ReadOnlySpan lightsTarget = lightsTargetBuffer[..indicatorLightsSpan.Length]; + + // Parse buttons + remainingLine = remainingLine[(indicatorLightsEndIndex + 1)..]; + + var buttonIndex = 0; + + while (remainingLine.IndexOf('(') is not -1 and var buttonStartIndex) + { + var buttonEndIndex = remainingLine.IndexOf(')'); + + var button = buttonsBuffer[buttonIndex]; + button.Clear(); + + var buttonSpan = remainingLine[(buttonStartIndex + 1)..buttonEndIndex]; + remainingLine = remainingLine[(buttonEndIndex + 1)..]; + + foreach (var splitRange in buttonSpan.Split(',')) + { + var lightIndex = int.Parse(buttonSpan[splitRange]); + button.Add(lightIndex); + } + + buttonIndex++; + } + + ReadOnlySpan> buttons = buttonsBuffer[..buttonIndex]; + + // Solve + stepsToSimulate.Enqueue(new SimulationState(new bool[lightsTarget.Length], 0, false, 0)); + stepsToSimulate.Enqueue(new SimulationState(new bool[lightsTarget.Length], 0, true, 0)); + + var minButtonPresses = int.MaxValue; + while (stepsToSimulate.TryDequeue(out var simulationState)) + { + var lightsState = simulationState.LightsState; + var nextButtonIndex = simulationState.NextButtonIndex; + var pressNextButton = simulationState.PressNextButton; + var buttonPresses = pressNextButton + ? simulationState.ButtonPresses + 1 + : simulationState.ButtonPresses; + + // Stop if there exist a solution with less button presses + if (buttonPresses >= minButtonPresses) + { + continue; + } + + if (pressNextButton) + { + // Press next button + var button = buttons[nextButtonIndex]; + foreach (var lightIndex in button) + { + lightsState[lightIndex] = !lightsState[lightIndex]; + } + + // Check if we reached the target lights + if (lightsState.SequenceEqual(lightsTarget)) + { + minButtonPresses = buttonPresses; + } + } + + // Prepare next steps + nextButtonIndex = (nextButtonIndex + 1) % buttons.Length; + + // If this is the last button in the list, only enqueue press (not pressing would lead to a loop and is already considered by the step before) + if (nextButtonIndex != buttons.Length - 1) + { + stepsToSimulate.Enqueue(new SimulationState(lightsState.ToArray(), nextButtonIndex, false, buttonPresses)); + } + stepsToSimulate.Enqueue(new SimulationState(lightsState.ToArray(), nextButtonIndex, true, buttonPresses)); + } + + totalButtonPresses += minButtonPresses; + } + + if (display) + { + AnsiConsole.MarkupLine($"[green]Total button presses: [yellow]{totalButtonPresses}[/][/]"); + } + } + + public override void RunPart2(bool display = true) + { + var totalButtonPresses = 0; + var linesProcessed = 0; + + var lines = Input.ReadAllLines(); + + var options = new ParallelOptions + { + MaxDegreeOfParallelism = 32 + }; + + Parallel.ForEach(lines, options, lineString => + { + var line = lineString.AsSpan(); + + // Parse data + Span joltageTargetBuffer = stackalloc int[10]; + + Span> buttonsBuffer = new List[20]; + for (var i = 0; i < buttonsBuffer.Length; i++) + { + buttonsBuffer[i] = new List(10); + } + + // Simulation data + var stepsToSimulate = new Stack(); + + // Parse line input data + var remainingLine = line[1..]; // Skip first square bracket + + // Parse buttons + var indicatorLightsEndIndex = remainingLine.IndexOf(']'); + remainingLine = remainingLine[(indicatorLightsEndIndex + 1)..]; + + var buttonIndex = 0; + + while (remainingLine.IndexOf('(') is not -1 and var buttonStartIndex) + { + var buttonEndIndex = remainingLine.IndexOf(')'); + + var button = buttonsBuffer[buttonIndex]; + button.Clear(); + + var buttonSpan = remainingLine[(buttonStartIndex + 1)..buttonEndIndex]; + remainingLine = remainingLine[(buttonEndIndex + 1)..]; + + foreach (var splitRange in buttonSpan.Split(',')) + { + var lightIndex = int.Parse(buttonSpan[splitRange]); + button.Add(lightIndex); + } + + buttonIndex++; + } + + ReadOnlySpan> buttons = buttonsBuffer[..buttonIndex]; + + // Parse joltage + var joltageSpan = remainingLine[(remainingLine.IndexOf('{') + 1)..remainingLine.IndexOf('}')]; + var joltageTargetIndex = 0; + foreach (var joltageRange in joltageSpan.Split(',')) + { + joltageTargetBuffer[joltageTargetIndex] = int.Parse(joltageSpan[joltageRange]); + + joltageTargetIndex++; + } + + ReadOnlySpan joltageTarget = joltageTargetBuffer[..joltageTargetIndex]; + + // Solve + stepsToSimulate.Push(new SimulationState2(new int[joltageTarget.Length], 0, false, 0, false)); + stepsToSimulate.Push(new SimulationState2(new int[joltageTarget.Length], 0, true, 0, false)); + + var minButtonPresses = int.MaxValue; + while (stepsToSimulate.TryPop(out var simulationState)) + { + var joltageState = simulationState.JoltageState; + var nextButtonIndex = simulationState.NextButtonIndex; + var pressNextButton = simulationState.PressNextButton; + var buttonPresses = pressNextButton + ? simulationState.ButtonPresses + 1 + : simulationState.ButtonPresses; + var pressedAnyInLoop = nextButtonIndex == 0 + ? false + : simulationState.PressedAnyInLoop || pressNextButton; + + // Stop if there exist a solution with less button presses + if (buttonPresses >= minButtonPresses) + { + continue; + } + + if (pressNextButton) + { + // Press next button + var button = buttons[nextButtonIndex]; + foreach (var joltageIndex in button) + { + joltageState[joltageIndex] += 1; + } + + // Check if we reached the target joltage + if (joltageState.SequenceEqual(joltageTarget)) + { + minButtonPresses = buttonPresses; + + continue; + } + + // Stop if any counter is higher than target (we cannot go down in value, only up) + var overflow = false; + for (var i = 0; i < joltageState.Length; i++) + { + if (joltageState[i] > joltageTarget[i]) + { + overflow = true; + + break; + } + } + + if (overflow) + { + continue; + } + } + + // Prepare next steps + nextButtonIndex = (nextButtonIndex + 1) % buttons.Length; + + // If this is the last button in the list, only enqueue no press if we pressed at least one button (to avoid infinite loops) + if (pressedAnyInLoop || nextButtonIndex != buttons.Length - 1) + { + stepsToSimulate.Push(new SimulationState2(joltageState.ToArray(), nextButtonIndex, false, buttonPresses, pressedAnyInLoop)); + } + stepsToSimulate.Push(new SimulationState2(joltageState.ToArray(), nextButtonIndex, true, buttonPresses, pressedAnyInLoop)); + } + + Interlocked.Add(ref totalButtonPresses, minButtonPresses); + Interlocked.Increment(ref linesProcessed); + + Console.WriteLine(linesProcessed); + }); + + if (display) + { + AnsiConsole.MarkupLine($"[green]Total button presses: [yellow]{totalButtonPresses}[/][/]"); + } + } + + private record SimulationState(bool[] LightsState, int NextButtonIndex, bool PressNextButton, int ButtonPresses); + + private record SimulationState2(int[] JoltageState, int NextButtonIndex, bool PressNextButton, int ButtonPresses, bool PressedAnyInLoop); +} \ No newline at end of file diff --git a/Inputs/Day10.txt b/Inputs/Day10.txt new file mode 100644 index 0000000..519d66c --- /dev/null +++ b/Inputs/Day10.txt @@ -0,0 +1,189 @@ +[.##.##] (4,5) (0,5) (2,3) (1,3,5) (0,3,5) (0,2,3,5) (0,1,4) (0,2,4,5) {198,181,22,50,173,65} +[#...##..#] (0,1,3,6,7) (0,1,4,6,7) (0,1,5,6,7,8) (0,1,3,5,7,8) (2,5) (1,4,8) (1,4,5,7,8) (3,5) (1,3,4,8) (0,2,3,4,5,7,8) (0,1,4,5,6,7,8) {38,59,4,35,41,34,31,46,43} +[.#.#.###.] (0,3,4,8) (2,4) (0,1,2,5,8) (3,4,5,6,7,8) (0,1,2,3,6,7) (1,3,5,6,7) (0,1,4,8) (0,1,3,4,7) (0,2,3) {64,47,42,52,33,35,16,20,43} +[....#] (2) (0,1,3,4) (1) (2,3,4) (1,2,3) {16,26,13,28,24} +[#..##] (3,4) (1,2,4) (0) (1,3,4) (2,3) {0,20,38,33,31} +[####.#.] (1,2,3,4,5) (0,1,2,3,4,5) (4,5) (4,5,6) (0,2,6) (0,2) (1,3,6) (0,1,2,3,5) (0,2,5) {227,70,247,70,53,75,201} +[#...###.] (1,4,7) (0,1,3,4,5,7) (0,5,6) (1,2,4,6,7) (2,3,4,5,6) (3,5) {18,27,19,35,41,35,19,27} +[#.###] (3,4) (0,1,2,4) (0,3,4) (0,2,3) (0) (1,4) (1,3) {46,23,25,58,54} +[.#.#] (0,1,2) (1,3) {9,18,9,9} +[##..##.#.] (0,1,2,3,4,7,8) (8) (0,4) (0,1,3,5,6,8) (1,3,4,5,6,7,8) (1,6) (0,2,5,7) (0,2,4) (3,4,7) (0,1,2,4,5,8) (1,3,7,8) {47,58,37,38,44,46,28,40,54} +[...#] (0,1,2) (0,3) (1,3) (3) (2,3) {12,22,9,40} +[.....#.#..] (0,1,2,3,4,6,8) (0,2,3,6,8,9) (0,2) (1,3,4,5) (0,1,2,3,4,5,6,8,9) (3) (1,3,4,6,7,8,9) (0,3,4,7,8,9) (1,5,6) (1,2,4,5,7,8,9) (2,3,4,5,7,8) (3,4,5,8) {61,66,74,87,77,53,62,59,93,68} +[.#..#] (1) (1,2) (0,1,2,3) (0,1,4) (1,3) (1,3,4) {18,69,35,36,13} +[.....#] (0,1,2,3,4,5) (1,2,3,4,5) (3,5) (0,1,2,4,5) {114,120,120,20,120,130} +[#.#.##.] (1,2,4,5) (1,5) (0,1) (3,4,5,6) (0,1,3,4,6) (1,2,3,4,5,6) (0,2,3,5) (0,1,2,5,6) {37,39,16,33,26,30,23} +[.####.####] (0,3) (2,4,6,8,9) (4,5) (0,2,3,4,5,6,9) (0,1,4,6,7,8) (0,1,2,3,5,6,7,8,9) (0,1,2,4,5,6,8,9) (1,6,7,8) (5) (8) (4,5,6,7,8) (5,7,8,9) (1,3,4,5,8) {56,62,21,50,55,57,57,49,257,21} +[....#.] (1,3,4,5) (0,1,2) (2,3,4,5) (0,1,2,4) {17,27,27,20,28,20} +[..##] (0,3) (0,2) (2,3) (1,2) {17,9,31,27} +[..###] (2,3) (0,1,4) (0,1,3) (1,3,4) (1,2,3,4) {7,12,18,30,5} +[#.##] (1,3) (0,2,3) {6,10,6,16} +[.####] (1,2,3,4) (0,2,4) (0,1,3) {18,20,10,20,10} +[####.] (0,1,2,3) (1,2,3) (1,2,4) {1,172,172,7,165} +[#.....####] (2,4,5,6,7,8) (0,2,3,4,6) (0,1,2,3,6,8,9) (0,1,2,3,4,6,8,9) (0,1,2,4,8,9) (0,1,3,4,5) (3,6,7) (0,2,6,7) (0,4) (0,2,3,4,5,6,7,9) {239,210,239,72,227,26,84,34,214,202} +[#.#.] (0,2,3) (1) (0,3) (0) (1,2) {132,14,126,116} +[###.##.#.] (1,3,6,8) (1,2,3,4,7,8) (4,7) (0,1,2,3,5,6,7) (0,2,4,6,8) (0,1,2,3,7,8) (3,5) (4,5,6) (0,1,2,3,8) (2,3,4,5,6,7,8) {17,116,121,127,148,31,33,132,122} +[.#..] (0,2) (0,1,3) (0) (2,3) (0,3) {34,12,30,33} +[...#.] (0,1) (3) (0,2,4) (0,2,3,4) {217,10,207,210,207} +[....#..##] (0,4) (0,2,4,8) (0,1,3,4,6,7,8) (0,1,3,6,7) (1,2,3,5,8) (1,2,3,4,5,7,8) (1,3,4,5,6,7,8) (2,3,8) (1,2,3,4,6,7,8) (0,1,2,3,4,8) (0,1,2,3,5) {63,89,91,105,88,49,35,55,98} +[#.###...] (0,4) (0,2,3,4,6) (1,2,4,5,6) (0,2,3,4) (5,6) (1,7) (7) (3,4,6) {12,36,31,22,41,32,45,26} +[.##..#.] (0,4,5,6) (0,1,2,3,4,6) (1,4) (0,2,3,4,5) (5) (0,2,4,5) {142,13,27,15,143,140,127} +[########.] (0,1,3,4,5,6) (3,5,7) (3,4,5,6,8) (1,5,7) (0,5,8) (0,1,3,4,6,7) (2) (2,3,4,6,7,8) {34,32,15,50,46,54,46,29,34} +[..#.#.#.] (0,3,4,5,7) (0,1,2,3,4,6,7) (0,2,3,7) (0,1,3,4) (0,4) (0,1,2,4) (4,6) (0,1,2,3,4,6) (2,3,4,6) (0,1,2,4,5,6,7) {77,56,57,60,187,25,156,44} +[.#..#] (2,3,4) (1,2) (2,3) (4) (1,3,4) (3,4) (0,2) {5,19,22,50,54} +[..#..] (0,1,2,4) (1,2) (0,3) (1,2,4) (1,2,3) (1,3,4) {36,67,50,40,41} +[#.#.#.] (0,2,4,5) (0,4) (0,1,4) (1,3) (0,2,4) (0,5) (2,4) {56,9,26,4,41,24} +[.##.##..] (7) (0,1,2,4) (0,2,3,7) (0,1,2,3,5) (2,7) (1,2,3,5,6,7) (2,3,4,5,6) (0,2,4,6) (0,3,6,7) {69,33,75,56,32,33,46,50} +[.###.] (0,2,4) (0,1,2) (1,2,3) (2,3,4) {18,23,35,17,12} +[..##..#] (0,5) (0,3,4) (0,1,2) (0,1,4,5,6) (1,6) {53,48,19,13,28,21,29} +[##.#] (1) (0,3) (2) {164,20,14,164} +[###.] (0,1,2) (1,2,3) {11,186,186,175} +[##....#] (0,1,2,4) (0,1,3,5) (0,1,2,6) (0,1,3,4) (0,3,6) (0,4,5) (0,1,2,4,5) {188,168,153,25,44,33,137} +[.#####.#] (0,2,7) (0,1,2,3,5,7) (0,1,3,5,6) (0,1,2,3,5,6,7) (0,3,4,5,7) (0,1,5) (1,2,4,5,6,7) (1,3,4,6,7) {56,76,55,44,30,71,47,66} +[#.#...##..] (0,1,2,4,5,6,8,9) (0,2,3,4,5,6,8,9) (0,1,5,8) (0,3,6,7,8,9) (0,6,7,9) (5,6) (0,2,3,7,9) (1,2,3,4,5,9) (2,4,8) {77,19,62,52,46,43,67,51,62,78} +[..#.] (0,1) (0,3) (2) {24,17,11,7} +[##.#] (0,2) (1,2) (0,3) (2) (1,3) (0,1) {42,36,37,19} +[.#####..##] (0,7,8) (0,1,2,3,5,7,8,9) (1,6) (2,6,8) (4,5) (1,3,4,6) (0,1,2,4,7,8,9) (4,5,6,8) (0,9) (6,7,8) (1,3,5) {23,38,23,21,42,23,52,21,41,21} +[#...] (0,1) (0,2,3) (0,3) (2,3) (1) (1,2) {221,21,203,217} +[.#.###] (0,1,2,4,5) (0,2,3,5) (0,1,4,5) (1,2,3,4,5) {154,32,156,152,32,169} +[..#.##] (2,3,4,5) (0,1,4) (0,1,2,3,5) (4) (3,5) (2,3) (0,1,2,4,5) {20,20,25,25,30,29} +[.#####.#.] (0,2,3,4,6,8) (0,1,3,4,5,6) (0,1,2,4,5,7) (2,5) (1,2,3,4,7) (0,1,2,4,5,8) (0,1,2,3,5,6,7) (0,2,3,4,7) (0,6,8) (1,8) {52,47,57,27,31,43,34,30,41} +[##.#.] (1,4) (0,1,3) (3) (0,4) (0,3,4) (2,4) {27,29,13,27,39} +[#..###....] (0,3,4,5,6,7,9) (0,3,4,5,6,7,8,9) (0,3,6,8,9) (0,1,5,6,7,9) (0,2,3,6,7,8,9) (4,6) (0,1,3,4,5,8,9) (0,8) {90,30,7,61,49,51,80,45,69,78} +[##..###] (0,1,3,4) (1,2,5,6) (2,3,5,6) (1,5) (1,3,4,5) (0,4) (2) {31,51,35,36,34,48,26} +[.###.####.] (1,2,3,4,5,7) (0,1,2,4,6,7,9) (1,2,3,4,5,6,8,9) (1,2,3,6,7,9) (1,3,5,6,8) (5,6) (0,2,5,6,7,9) (0,5,7,8) (1,2,3,4,7,8,9) {27,74,89,70,52,70,71,82,39,72} +[###.....#.] (6,8) (3,4,5,7,9) (1,2,7) (0,1,2,4,7,8,9) (1,4,7,9) (0,2) (2,4,5,9) (1,3,9) (5,8) (0,2,4,5,7,9) (1,2,3,4,5,7,9) (2,4,5,7,9) (3,4,7,8,9) {28,34,37,37,74,45,9,72,55,77} +[.###.] (1,4) (0,1,3) (1,2,3) {3,11,2,5,6} +[##....#.] (2,3,4,6) (1,2,5,7) (1,4,7) (0,2,3,4,5,7) (1,2,3,5,6) (2,3,4,5,6,7) (0,2,3,5,6) (0,2) (2,6,7) (1,4,6,7) {27,177,232,72,72,184,90,203} +[###.###..] (3,4,7) (0,1,2,3,4,5,8) (4,6) (0,3,4,5,7,8) (0,1,2,3,5,6,7) (0,1,2,4,6,7,8) (0,8) (1,2,7) {261,233,233,245,246,234,41,70,241} +[#..#..#] (0,1,2,5,6) (2,3,4) (0,1,2,3,5,6) (1,2,3,5) (0,1,2,3,4) {159,162,179,178,166,13,10} +[...#.#...] (0,3,4,5) (1,5,7,8) (4,6) (0,2,3,4,6,7,8) (2,4,8) (0,1,2,3,4,5,7,8) (3,5) {29,8,43,29,61,14,28,24,44} +[##..###.#] (0,1,2,4,5,6,8) (3,4,5,6,7) (0,3,6,8) (5,6) (2,3) (0,2,3,4,5,6) (0,1,2,3,4,5,6,8) (0,1,2,3,5,7) (2,8) (0,2,3,4,5,6,7,8) {61,34,222,204,64,74,71,25,53} +[##.#] (0,1,3) (0,2) {178,168,10,168} +[#..##] (0,2,4) (0,3) (0,1,3,4) (0,1,3) (0,1,2,3) {27,22,6,23,23} +[###.#.] (1,2,4) (2,3,4) (3,4) (0,3) (0,2,5) (1,2) {23,11,45,31,26,18} +[..##.###..] (4,5,7) (0,1,2,3,4,6,7,8,9) (0,1,2,3,4,5) (2,3,5,6,7) (1,2,3,8,9) (0,1,2,3,4,5,8,9) (0,5,6) (0,1,2,3,4,5,7,8) {21,38,42,42,35,39,4,21,21,18} +[.##.] (0,1) (0,3) (0,2) (1,2) {42,4,21,19} +[...###.] (1,2,3,5) (1,3,4,6) (0,1,2,5,6) (1,2,3,5,6) (0,1,6) (2,4) (1,2,5) (3,4,5) {23,47,28,30,11,38,34} +[#...#] (2,3,4) (1,2,4) (0,1,3) (0) (2,3) {3,5,16,11,9} +[.#.#..#] (0,1,4) (1,2,3,6) (4) (1,2,3,4,5) (0,2,3,5) (3,4,5) (2,4,5,6) (2,4) {23,38,67,37,80,43,28} +[.##.#] (0,1,2) (0,2) (0,2,3,4) (2) (2,4) {29,13,47,0,12} +[#.#..#.] (3,4,5,6) (4,6) (0,1,2,4,5,6) (0,1,2,3,5) (1,3,4,5,6) {14,26,14,28,30,28,30} +[#...#...] (0,1,2,3,4,5,6) (0,1,4,5,6,7) (0,1,2,3,6,7) (0,3,4,5,6,7) (2,5) (0,2,3,5,7) (0,3,4,5,6) (5,7) (1,7) {85,41,45,72,58,99,68,84} +[.#..##..##] (2,3,5,6,7,8,9) (2,3,5,7,9) (2,3,4,5,8) (0,1,2,3,4,5,6,7) (0,5,7,8) (2,3,4,5,7) (1,4,6,9) (6,8) {21,5,51,51,19,69,22,56,48,36} +[#.##.##.#] (3,8) (0,3,4,5,6,7,8) (1,4,8) (0,2,4,5,6,7,8) (0,1,2,3,5,6,7,8) (0,1,2,4,5,6,8) (0,1,3,4,5,6) (0,1,2,3,4,7,8) {258,240,240,50,246,245,245,57,254} +[.#.##...] (0,3,4,5,6,7) (3,6) (1,5,7) (0,2,3,5) (3,4,5,7) (0,2,4,7) {18,8,12,26,22,22,18,30} +[####..##..] (0,2,3,5,7,8,9) (1,3,4,7,8) (1,2,3,6,7,8,9) (1,7) (0,3,4,5,8,9) (2,3,4,5,6,7,8,9) (0,2,3,5,6,7,8,9) (2,5,8) (1,5,9) {38,43,72,83,48,90,40,65,101,89} +[.#.#.#] (0,1,4,5) (3,4,5) (0,1,2,4,5) (1,2,3,5) (1,2,3,4) (1,2,3,4,5) {20,54,49,48,62,59} +[#.##] (1,2) (0,1,3) (0,2,3) {23,28,35,23} +[#.##.#..##] (4,5,7) (0,2,3,4,7) (1,2,3,4,5,6,8) (1,2,3,5,6,8,9) (2,7) (0,1,5) (1) (1,2,5,6,7,8) (1,4,5,7,8,9) (0,3,6,7,9) (0,1,4,5,8) (0,4,6,9) {49,72,49,37,89,72,50,67,56,46} +[...#.] (1,2,3,4) (2,3) (0,2,3,4) (1,3,4) {20,25,177,184,45} +[#...##] (0,2,4,5) (0,4,5) (0,1,2,4) (4,5) (0,1,3,5) (0,1) (3,4,5) (2,4) {48,28,10,28,40,57} +[##.#...##.] (0,4,8) (0,1,4,6) (3,5,7) (1,5,8,9) (4,5,8) (1,2,3,5,7,8,9) (2,5) (1,3,9) (0,1,2,8) (0,2,6,7) (2,3,4,5) {215,41,227,39,64,85,195,207,68,30} +[.##.##] (0,1,3,4,5) (0,1,4,5) (0,2,3) (0,1,2,3,4) {25,20,19,24,20,6} +[##...##.] (1,3,4,5,6,7) (0,1,2,3,4,5,6,7) (1,2,4,5,7) (0,1,2,6) (1,2,3,6) (1,2,3,4,7) {8,50,33,30,43,41,30,43} +[##..] (0,2) (0,1) (0,3) (3) (1,3) {11,20,4,30} +[...#] (0,1,2) (0,2) (0,2,3) {32,10,32,12} +[#####.] (0,2,5) (3) (1,2,3,4) (0,1,2,3,4) (0,3,4,5) {13,167,170,186,168,4} +[###..#.#] (4,7) (0,1,7) (1,3,4,5,6,7) (2,4) (0,3,4,5,6) (1,2,4,7) (2,5,7) (0,1,2,7) (2,4,6) {24,128,164,20,181,33,39,160} +[....#..##] (2,4,6) (0,1,6,7,8) (0,2,4,5,7,8) (1,2,3,4,5,6,8) (2,5,6,7,8) (2,3,4,5,6,8) (1,3,4,5,6,7,8) {14,24,61,32,47,61,54,34,63} +[.####.#.] (0,1,2,4,5,6) (1,2,4,5) (0,2,3,6) (1,2,3,5,6,7) (0,2,6,7) (1,6,7) (2,3,5) (1,4,5) (1,2,3,4,6) {40,140,66,30,28,42,157,130} +[###..##.##] (3,4,6,8,9) (0,5) (0,1,3,6,7,8,9) (4,8,9) (1,2,3,4,5,7,9) (1,2,3,4,6,7,8,9) (0,3,5,6) (4,6,7,9) (1,2,3,4,5,6,7,8) (0,1,2,5,6) (1,3,5) {6,33,21,42,42,26,30,30,32,39} +[###.###.] (5) (1,4) (3,5) (0,4,5,7) (0,1,2,4,5,7) (1,5,6) (0,4,5,6,7) (0,1,2,4) {27,31,9,5,45,46,12,19} +[###..#.###] (0,2,6,9) (1,4,5) (0,5) (0,1,4,6,7,8,9) (2,3,4,6,8,9) (0,5,7,9) (0,3) (1,2,4,7,8,9) (3,8) (3,5,8,9) {42,38,33,19,43,12,37,40,55,57} +[..##...##.] (5,7) (0,4,6,7) (0,6) (1,2,4,7,9) (0,3,4,6,7,8,9) (0,2,3,5,6,8) (0,1,2) (1,3,5,8,9) (0,1,2,3,5,9) (1,2,4,5,6,7,9) (0,2,3,4,7,8,9) {169,64,189,161,44,178,146,60,149,62} +[###...#.#.] (0,1,2,3,4,7,8) (0,1,3,9) (1,2,5,6,8,9) (0,1,4,5,7,9) (1,2,7,8) (5,6) (3,6,7,8,9) (5,6,8) (2,3,6,7,8) {32,50,39,49,13,45,62,48,62,50} +[##.##] (1,2,4) (2,3,4) (3) (0,1,4) {2,21,39,172,41} +[.####.###.] (1,3,8,9) (0,2,3,4,7,9) (1,3) (2,3,4,5,7) (0,5,6,8) (0,1,4,8,9) (0,3,4,8) (1,2,4,5,6,7) (1,2,3,4,6,7,8,9) {55,56,38,56,69,31,32,38,67,54} +[..##..#.] (0,1,3,4,5,6,7) (1,2,4,5,6,7) (3) (0,3,5,6) (0,1,2,3,4,5,7) (0,4,5) {39,36,30,46,43,50,24,36} +[####..#.#] (1,3,4,7,8) (1,2,4,7,8) (0,2,4,5,7) (2,3,5,7,8) (6,8) (0,1,2,4,5,7,8) (0,2,4,5,6) (0,1,3,4,5,7) (0,4,7) (0,1,2,3,4,6,8) {46,41,63,31,72,54,218,60,246} +[....#.#.] (0,1,2,4,6,7) (1,2,4,5,7) (0,1,3,4,5,7) (2,5,7) (0,1,2,4,5,6,7) (0,4,5) {57,61,60,20,62,64,36,80} +[#..###] (0,1,2,5) (1,5) (0,1,2,3,4) (1,2,3,4) (0,5) (0,2,3,5) {51,54,37,18,17,53} +[.#.#.#..] (0,2,3,4,5,7) (0,2,4,5,7) (0,1,5,7) (0,1,2,3,5,6) (1,4,7) (5,6) (3,4,5,7) {43,16,37,33,40,73,28,46} +[.#..] (0,1,3) (0,2,3) (1) {21,20,11,21} +[.....#.###] (0,1,2,4,6,7,9) (0,5) (2,4,5,6,8,9) (2,9) (1,4,5,6,7,8,9) (3,4) (0,3,4,6,7,8,9) (0,1,3,4,5,6,7,8) (0,1,3,9) (2,4,5,6,7,9) {43,40,47,26,64,44,57,47,35,82} +[...#.#.#.] (1,2,3,4,7) (1,4,6,7) (0,1,2,5,6,8) (0,1,2,3,7,8) (0,1,2,3,4,6,8) (1,3,4,5,6) (0,1,3,8) (7,8) (3,5,7) (2,3,4,5,6,7,8) {34,61,47,70,40,42,34,58,45} +[##.#..#] (1,2,3,6) (2,5) (0,5) (0,1,3,4,5) (0,1,3,6) (1,4,5,6) {8,143,11,7,136,148,143} +[......###] (0,1,2,3,4,8) (2,3,5,6,7,8) (0,1,3,4,6,7,8) (1,3,4,5,6,7,8) (4,5,7) (0,1,3,4,7,8) (2,4,7) (0,1,4,6,7,8) {46,51,23,43,79,21,34,74,53} +[######] (0,4,5) (0,1,2,3,5) (4) (0,1) (0,2,3) (1,3,4,5) (2,4,5) {31,15,24,18,30,22} +[#...#] (1,4) (2,3,4) (0,2,3) {17,10,29,29,22} +[##.#.#...] (2,3,4,8) (1,2,3,4,5,7,8) (0,3,4,5,6,8) (1,2,3,5,6,7) (1,4,5) (0,1,4,5,6,7,8) (0,1,2,3,6,7,8) (3,5,6) (0,5,6,7) (1,3,4,6,7,8) (0,1,2,3,5,7) {23,75,53,85,70,78,51,62,54} +[.##.###] (2,3,6) (1,2,3,5) (2,3) (0,4,5,6) (1,2) (0,3,4,5,6) (1,3,4,5) {13,23,19,38,28,32,23} +[.####.#] (3) (1,5,6) (0,1,2,3,6) (0,1,4,5,6) (1,4,5) {28,40,19,20,19,21,30} +[.#.#.#] (0,2,4) (0,1,2,5) (4) (0,2,3,5) (0,1,2,3) (1,2,4) (0,1,4,5) (1) {44,44,53,20,186,19} +[###..] (0,3,4) (0,1,4) (0,1,2) (1,3,4) (2) {35,27,30,28,28} +[#.###.###.] (1,2,3,4,5,6,7,9) (0,3,4,6,8) (2,4,7,9) (0,2,5,9) (0,3,7,8) (1,2,3,4,5,6,8,9) (1,8) (0,2,3,5,6,7,8,9) (1,3) (0,1,3,6,7) (0,5,7,8,9) (1,2,3,5,7,8) (1,2,3,4,5,6,8) {46,62,75,70,45,86,54,54,78,75} +[#...##.###] (2,3,5,7) (0,2,3,4,5,6,8,9) (2,3,6,9) (1,5) (2,5,8) (0,1,3,4,5,7,8) (0,1,2,4,6,7,8,9) (0,3,4,5,7,8,9) (0,5,6) (3,4,5,6,7,8,9) (0,1,4,5,6,8,9) (0,1,2,4,5,6,9) (0,2,3,4,5,6) {94,33,68,71,79,111,84,36,63,79} +[###.###..] (1,2,3,6,7,8) (0,2,3,4,5,7,8) (2,6,7) (5,7) (4,6,7) (2,3,4) (1,2,3,4,5,6,7) (0,4,8) {13,4,26,15,31,6,20,22,13} +[#...#] (2,3) (0,1,2,4) (0,4) (0,2,4) (1,2) {24,30,46,14,24} +[..#..#.##.] (1,8) (1,6,7,9) (0,3,8) (0,1,2,4,5,8) (0,4,6,9) (1,2,3,5,6,7,8,9) (0,1,2,3,5,6,9) (4,5) (1,3,7,8) {30,35,13,19,30,27,27,17,29,27} +[....#.##.] (0,2,3,5,6,7,8) (1,3,4) (2,3,6,7,8) (1,2,3,5,6,8) (1,2,3,4,6,7,8) (2,5,7,8) (3,8) (0,5,6,7,8) (0,1,3,4,5,7) {23,43,58,84,28,39,57,56,72} +[###.#.] (0,2) (0,2,3,4,5) (3,5) (0,1,2,4) (2,3,4,5) {31,14,31,28,24,28} +[#.#......] (0,1,2,4,5,8) (0,1,2,3,4,5,6,8) (2,3) (0,1,3,7) (0,4,6,8) (4,5) (0,1,3,4,7,8) {75,61,23,47,64,30,23,38,57} +[#..####..#] (0,1,2,3,5,6,7,9) (6,7,8,9) (1,3,5) (0,6) (0,1,5,8,9) (2,6,7,8) (0,2,3,4,6,7,8,9) (0,1,4,5,7,8) (2,3,5,6,7,8,9) (0,2,3,4,5,7,8,9) (1,3,4,6,7,8) (0,4,5,8,9) (0,1,2,5,6,7,8) {97,72,75,76,50,94,83,89,97,82} +[#.##..] (0,3) (1,2,4,5) (1,2,3,5) (0,4) (0,2,5) (0,1,3,4,5) (0,1,5) (1,2,3,4) {47,64,63,47,47,67} +[#..##] (3) (1,3) (2) (0,2,3) (0,1) (0,1,2) (0,1,4) {6,10,126,21,3} +[###..###.#] (0,3) (3,4,9) (0,2,6,7,9) (4,6,7,8,9) (3,9) (2,3,5,9) (1,4) (1,2,4,6,7,9) (1,3,4,6,7) (0,4,5,6,7,9) {48,37,27,224,87,24,70,70,12,237} +[..##......] (0,2,5,6,9) (0,2,3,4,5,6,8,9) (0,1,4,5,7,8) (0,2,3,5,6,7,8) (1,7) (0,1,2,3,4,6,7,8) (0,1,3,4,6,7,8,9) (5,7,8,9) (0,1,3,4,5,6,7,9) (2,3,4,5,6,8,9) (0,1,3,7,8,9) (2,4,7) {230,50,217,218,66,218,212,244,232,60} +[###.#.#] (2,5) (2,4) (1,2,4,5) (0,1,4,5,6) (0,3,5,6) (2) (0,3) (1,4,5,6) {25,19,54,19,35,51,28} +[#.###.] (1,2) (0,1,2,5) (1) (0,1,2,4,5) (2,3,4,5) {30,56,47,11,28,41} +[###.#.#.#.] (2,5,6,7,8) (0,1,3,6,9) (0,3) (0,1,9) (3,7,8) (1,2,3,7) (0,1,5,6,7,8) (3,5,7,8) (1,3,5,9) (0,2,3,4,5,6,7,9) (3,5,7,8,9) (1,2,3,7,8) {46,79,165,112,17,173,148,206,171,61} +[.#...] (0,1,4) (0,2,3) (0,1,3) (1,2) (1,3,4) (3,4) {34,43,19,64,36} +[###.#..] (0,5) (0,1,2,4,6) (0,3,4,5) (0,1,3,4,5) (0,3,5) (0,2,3,4,6) (0,1,2,6) (0,3,4,5,6) {239,18,187,224,225,52,205} +[..#...#] (1,4,5,6) (0,1,2,3,4,6) (2,6) (0,4,6) (0,4) (0,3,4,5,6) (1,2,5) {46,17,13,25,53,32,50} +[......#.] (1,4,5,6) (2,4) (1,2,7) (0,2,5,6,7) (2,5) (0,1,2,4,5,7) (3,6) (0,1,2,6,7) (0,6,7) (1,2,6,7) {23,41,50,0,9,15,36,50} +[..#....#] (0,3,4,5,6,7) (0,1,2,3,4,7) (3,6,7) (0,6,7) (2,4,5,6) (0,1,2,3,7) (0,1,2,5,6) {43,22,28,35,30,19,30,44} +[#.##.] (2) (0,2,3,4) (0,2) (0,2,3) (0,4) (1,3,4) {145,4,147,141,7} +[.##......#] (0,1,2,3,4,5,7,9) (3,7,9) (0,1,3,4,6,7,9) (0,2,4,8,9) (0,1,3,4,6,9) (0,2,8,9) (2,3,5,7,9) (1,3,5,6,7,9) (0,2,3,5,6,7) (1,2,6,9) {81,36,81,64,49,43,45,46,33,84} +[##...###.] (0,4,6,7) (0,1,2,3,5,8) (1,2,4,5,7,8) (1,3,4,5,7) (1,5) (0,1,5,6,7) (3,6) (0,1,3,5,6,7,8) (1,2,5,6,7) (3,4) (2) {22,51,40,24,41,51,42,54,24} +[..#.] (3) (0,1,2) (2,3) (1,2,3) {1,147,149,165} +[..##.#.#] (0,1,3,4,5,6,7) (2,5,6) (3,4) (0,1,4,5) (4,6) (1,2,3,4,6,7) {7,22,28,23,37,20,39,17} +[...#...#] (0,2,4,5) (0,2,3,5,6,7) (0,2,4,5,7) (4,7) (0,3,6) (2) (0,1,2,5,6,7) (0,3,5,6,7) (0,1,2,4,5) (1,2,5,7) {60,35,77,16,36,71,35,64} +[..#..#.] (0,1,5) (3,4,6) (1,3,4,6) (0,2,6) (0,3,5,6) (1,2,3,4) (0,6) (1,4,6) {39,50,13,31,45,20,57} +[..#...] (0,1,2,5) (0,4,5) (1,3,4,5) (1,4) (0,1,3) (1,2,3,4,5) {122,58,22,36,148,144} +[#.##...] (3,4) (2,5) (0,2,3,4,5) (1,2,3,4) (0,1,2,4,5) (0,6) {41,7,28,21,28,28,14} +[.##....##] (1,4) (0,1,2,3,8) (0,1,2,3,4) (2,3,4,6,7,8) (0,1,3,4,5,6,8) (7,8) (0,2,5,6,8) (1,2,3,4,5,6,7,8) (4,6,7) {32,35,48,39,60,11,39,43,41} +[#.##] (1,2,3) (3) (2,3) (2) (0,2,3) (1) {14,168,60,51} +[...##...#] (0,1,2,3,5,6,7,8) (0,4,5,7) (3,4,8) (0,2,4,5,6) (1,2,3,5,7,8) (0,1,2) (0,3,5) (1,3,5,6,7,8) (1,3,5,7,8) (0,1,2,4,5,6,7,8) {68,55,43,52,30,68,29,52,45} +[#..##] (0,3,4) (1,4) (1,2,4) (1,2) (0,1) (0,4) {28,31,18,8,18} +[#.##...##] (0,2,3,4,5,7,8) (2,3,4,5,6,7,8) (0,1,2,4,5,7,8) (0,6,7,8) (0,1,3,8) (1,6,8) (2,8) {42,23,170,46,28,28,34,41,205} +[###.#..#] (0,5,7) (1,4,5,6) (0,1,2,3,5,6,7) (1,3) (1,2,6,7) (0,3,5,6) (0,5,6,7) {33,49,31,28,7,40,44,47} +[...##] (0,2,4) (1,3,4) (2,3,4) (1,3) (3,4) (0,2) (0) {49,13,31,17,19} +[.##...#.] (0,1,2,3,4,5,7) (0,2,3,4,6,7) (0,1,2,4,5,6,7) (1,2,4,5,6) (0,1,3,5,7) (0,1,2,4,6,7) (4,5) {76,63,60,52,67,53,43,76} +[....##...#] (3,6) (0,1,2,4,5,6,7,8,9) (0,1,2,3,4,7,8) (2,3,4,5,7) (2) (3,5,6) (3,4,5,6,9) (0,2,4,5,6,8,9) (0,3,4,9) (0,2,3,4,5,6) (0,4,6,7,8,9) (2,3,6,8) {60,13,70,71,64,47,84,28,47,39} +[..##.] (4) (0,1,4) (1,2,4) (0,3,4) (2) (0,2) {32,35,43,4,49} +[.#...#] (0,3,4,5) (0,2,5) (0,2,4,5) (0,1,3,4) (2,3) (1) (0,2) {62,23,43,29,30,33} +[##...#####] (2,3,4,6,7,8) (9) (1,2,8,9) (0,4,9) (0,1,2,3,4,5,6,9) (1,3,4,5,6,7,9) (0,7) (1,8) (0,1,3,4,6,7,8) (0,2,5,9) (0,1,5,6,7,8,9) (7,8) {183,182,41,175,177,32,183,180,177,54} +[##.#] (0,1,2) (1,2,3) (2,3) (1) (0,2) {18,26,29,11} +[#..##.#] (3,4,5) (4,6) (3) (1,2,3,4,6) (1,3,4,5,6) (0,2,4,6) (0,1,5,6) (1,2,3,4,5,6) (1) {10,47,23,42,51,31,53} +[...#.] (1,4) (1,3,4) (0,1,3) (1,3) (2,3) (3,4) (4) {11,36,2,44,198} +[#.#.] (0,2) (1,2,3) {20,156,176,156} +[#....] (0,1,3,4) (0,1,2,3) (1,2,3) {28,29,15,29,14} +[###...] (0,4) (1,2,4) (1,5) (0,1,2,3) {12,38,26,11,16,12} +[..###.] (0,1,3,4) (0,2) (4,5) (2) (0,1,2,4) (1,3,5) (0,1,2,4,5) {32,26,38,3,36,19} +[..#..#.] (0,1,3,5,6) (3,4,5) (0,4) (1,3,5) (0,1,4,5,6) (2,5) (2,3,4,5,6) {39,44,26,48,45,78,51} +[#...] (1,3) (2,3) (0,3) (0,1,2) {11,15,7,24} +[##.####] (1,2,4,5) (0,1,2,3,5) (2,3,6) (3,4) (0,1,3,4,6) {27,42,41,207,196,35,13} +[...#...#] (0,2,3,4,6) (1,2,3,7) (6,7) (2,5) (0,2,4,5,6,7) (0,1,2,3,4,5) (3) (0,1,3,7) (3,6) {44,27,31,58,24,10,33,36} +[####...##] (4,5,6,7,8) (0,2,5,6,7,8) (0,1,3,4,6) (3,8) (2,3,4,6,7) (2,4,6,7,8) (0,1,2,3,4,6,7,8) (0,4,7,8) {33,22,51,43,64,23,75,63,56} +[.##..#] (0,2,3) (2,3,4) (2,4,5) (0,1,4) (1,5) (5) (0,1,2,3,4) (1,2,5) {33,43,47,32,40,33} +[.##.#..#..] (1,2) (0,1,2,3,5,7,8) (3,7,9) (0,1,2,4,5,6,8) (2,7) (0,1,2,3,4,6,7,8,9) (0,1,2,6,7,9) (4,6) (0,1,5) (0,1,3,4,5,7,8,9) {46,66,57,39,35,42,17,58,37,31} +[##.#] (0) (0,1,3) (1,3) (1,2) (2,3) (0,1,2) {21,35,28,39} +[####..#.#] (0,1,2,3,4,5,7) (4,5) (6,7,8) (1,2,3,4,5,6,8) (0,3,4,6,7,8) (0,2,4,5,8) (0,1,2,3,5,6,8) (3,7,8) (0,2,4,5,7) {48,37,47,62,67,59,62,52,67} +[.#.##.#] (3,5) (5,6) (0,1,2,3,5,6) (2,3) (0) (1,4,5,6) (1,2,4,6) (0,1,3,5) (4) {33,62,31,42,41,72,61} +[.#####] (1,2) (0,2,4) (3,5) (4) (0,2,5) (3,4,5) (0,1,3,5) (3) {32,7,25,202,32,200} +[..#.] (0,1) (0,3) (2) (0,2) (1,2) {35,39,37,6} +[##.#..] (0,2,3,4) (0,2,5) (0,2) (3,5) (0,5) (0,1,2,4) (1) (4,5) {30,21,21,7,18,30} +[.....#.] (1,4,5) (0,1,3) (1,4) (0,1,2,3,4,6) (1,2,6) (2,4,5,6) {193,235,212,193,228,32,212} +[.#..#..##] (2,7) (0,5) (0,1,7) (0,1,3,7) (4,8) (1,2,3,4,5,6,8) (0,1,2,3,4,5,6,8) (1,2,3,5,6,8) (1,7) {193,203,52,54,38,54,38,179,45} +[#..#.#] (3,5) (0,1,2,3,5) (2,4) (0,3,5) (0,1,5) {11,6,9,22,9,28} +[.#.#.##] (0,1) (0,2,3,5,6) (0,2,3,5) (0,1,2,3,5) (0,2,4,5,6) (4,5,6) (1,2) (4,5) {39,25,40,28,4,32,20} +[....##.#..] (0,2,3,4,5,6,7,8,9) (0,3,4,6,7,8,9) (6,7) (1,5) (0,2,3,9) (2,8,9) (1,6,9) (0,1,3,5,6,7,8) {50,39,35,50,17,39,64,47,42,52} +[####.##.] (0,1,2,4) (1,3,5,6) (2) (1,3,6) (0,1,3,7) (0,2,5,6) (0,2,7) (4,7) {49,37,38,21,18,1,7,34} +[.##.###.] (2,4,5,7) (4,5,6,7) (1,3) (0,1,2,7) (0,1,3,4,6,7) (2,5,6,7) (1,2,4,5,6) {20,49,64,12,41,50,34,52} +[.#....] (2) (1,2,3,5) (0,2,3,4,5) (1,3,5) (2,3,4) (1) {14,32,178,172,153,33} +[.####...] (0,1,2,4,6,7) (0,2,3,4,6,7) (1,2,3,6,7) (0,4,5,6,7) (0,1,2,3,5,6,7) (1,2,3,5,6,7) {48,40,58,46,46,33,74,74} +[.#.###.] (0,2,3,4,5,6) (1,2,4,5) (6) (0,1,3,4) (1,2,6) (2,3) (0,5,6) (3,4,6) (1,3,4,5,6) {35,33,58,55,52,40,189} +[#..####.] (1,3,4,5,6,7) (0,1,3,4) (2,4,6) (1,2,3,4,5,7) (0,1,3,4,6,7) (0,3,5,7) (0,1,4,7) {30,55,16,43,62,29,26,44} +[#.#.#..#.#] (0,1,2,3,4,5,7) (3,5) (0,1,2,4,6,7,8,9) (1,2,3,7,8,9) (0,1,6,9) (2,3,4,5,6,9) (1,2,4,9) (5,7) (0,2,8,9) {45,150,171,151,28,42,38,147,150,183} +[..##] (0,2,3) (0,3) (1,2,3) (0,1,3) {202,19,15,213} \ No newline at end of file