Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-seguin committed Dec 20, 2023
1 parent 53be34a commit 5169f70
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 2023/Day08/Solution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace AdventOfCode.Y2023.Day08;
[ProblemName("Haunted Wasteland")]
class Solution : Solver
{
private static readonly string[] Separator = { " = " };

public object PartOne(string input)
{
var lines = input.Split("\n", StringSplitOptions.RemoveEmptyEntries);
Expand All @@ -28,12 +30,12 @@ public object PartTwo(string input)
return CompleteGhostsTravel(directions, map);
}

private Dictionary<string, (string, string)> ParseMap(List<string> lines)
private static Dictionary<string, (string, string)> ParseMap(List<string> lines)
{
var map = new Dictionary<string, (string, string)>();
foreach (var line in lines)
{
var parts = line.Split(new[] { " = " }, StringSplitOptions.None);
var parts = line.Split(Separator, StringSplitOptions.None);
var key = parts[0];
var values = parts[1].Trim('(', ')').Split(',');

Expand Down

0 comments on commit 5169f70

Please sign in to comment.