public void Part2(string[] lines) { var startNode = Cave.BuildCaveGraph(lines); var completedPaths = new List <string>(); Stack <Cave> nodes = new Stack <Cave>(); nodes.Push(startNode); var currentPath = new List <Cave>(); var currentPathSmallCaves = new HashSet <string>(); VisitCave(startNode, currentPath, currentPathSmallCaves, true, null, completedPaths); Console.WriteLine("Completed paths:"); foreach (var path in completedPaths) { //Console.WriteLine(path); } Console.WriteLine($"Total number of paths: {completedPaths.Count}"); }