Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaKateryna committed Dec 5, 2023
1 parent 7ce65d2 commit bfb9ea6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AdventOfCode/Day05.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override ValueTask<string> Solve_2()
seeds[i / 2] = new Range(_seeds[i], _seeds[i + 1]);
}

long location = seeds.Select(s => FindRanges(s)).SelectMany(l => l).Min(r => r.Start);
long location = seeds.Select(s => FindLocationRanges(s)).SelectMany(l => l).Min(r => r.Start);

return new(location.ToString());
}
Expand All @@ -60,7 +60,7 @@ private long FindLocation(long seed)
return value;
}

private List<Range> FindRanges(Range range)
private List<Range> FindLocationRanges(Range range)
{
List<Range> ranges = [ range ];
for (int i = 0; i < _maps.Length; ++i)
Expand Down

0 comments on commit bfb9ea6

Please sign in to comment.