Skip to content

Commit

Permalink
Clean day 8
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Dec 8, 2023
1 parent 4ee222c commit b4fd014
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/AoC_2023/Day_08.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ public Day_08()
_input = ParseInput();
}

public override ValueTask<string> Solve_1() => new($"{Solve_1_Original()}");

public override ValueTask<string> Solve_2() => new($"{Solve_2_Original()}");

public int Solve_1_Original()
public override ValueTask<string> Solve_1()
{
const string start = "AAA";
const string end = "ZZZ";
Expand All @@ -56,12 +52,12 @@ public int Solve_1_Original()

if (currentNode.Id == end)
{
return counter;
return new($"{counter}");
}
}
}

public ulong Solve_2_Original()
public override ValueTask<string> Solve_2()
{
var startNodeList = new List<BinaryTreeNode>(_input.Nodes.Count);
var endNodeList = new List<BinaryTreeNode>(_input.Nodes.Count);
Expand Down Expand Up @@ -108,7 +104,9 @@ public ulong Solve_2_Original()
}
}

return SheepTools.Maths.LeastCommonMultiple(repetitionPeriodAfterEnd);
var result = SheepTools.Maths.LeastCommonMultiple(repetitionPeriodAfterEnd);

return new($"{result}");
}

private (string, Dictionary<string, BinaryTreeNode>) ParseInput()
Expand Down

0 comments on commit b4fd014

Please sign in to comment.