#define Day23 #if Day23 var lines = File.ReadAllLines("day23/input") .ToList(); var aStack = new Stack(); var bStack = new Stack(); var cStack = new Stack(); var dStack = new Stack(); var stackSpace = new Dictionary, int>() {{aStack, 2}, {bStack, 4}, {cStack, 6}, {dStack, 8}}; var moveCost = new Dictionary() {{'A', 1},{'B', 10},{'C', 100},{'D', 1000}}; var spaces = Enumerable.Repeat('.', 11).ToArray(); foreach ((var stack, var space) in stackSpace) { int pos = 2; while (pos < lines.Count && lines[pos][space+1] != '#') { stack.Push(lines[pos][space+1]); pos++; } } Console.WriteLine("adsf"); long Solve(Dictionary, int> stackSpace, char[] spaces) { if (spaces.Any(c => c != '.')) { } // first check that all chars from spaces that can be moved to its corresponding stack has been moved // if possible, call recursive (remember what has been moved and undo after call) // iterate all stacks, check if stack contains element that does not fit. then move the top most element // after move, call recursive // if move is not possible, return int max? each recursive all needs to optimize su-calls to minimum. hand down current minimum to check against? (can be done in second step. solve first?) } #endif