Day 12 Remove unused import
This commit is contained in:
parent
aef252b460
commit
16178b5f04
7
Day12.cs
7
Day12.cs
|
|
@ -1,7 +1,6 @@
|
||||||
#define Day12
|
#define Day12
|
||||||
#if Day12
|
#if Day12
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Diagnostics;
|
|
||||||
using AoC2021;
|
using AoC2021;
|
||||||
const string START = "start";
|
const string START = "start";
|
||||||
const string END = "end";
|
const string END = "end";
|
||||||
|
|
@ -37,8 +36,7 @@ long PathCountPart1(Dictionary<string, ImmutableHashSet<string>> paths, Immutabl
|
||||||
foreach (var a in adjacent) {
|
foreach (var a in adjacent) {
|
||||||
if (a.ToLower() == a) {
|
if (a.ToLower() == a) {
|
||||||
count += PathCountPart1(paths, visitedSmallCaves.Add(a), a);
|
count += PathCountPart1(paths, visitedSmallCaves.Add(a), a);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
count += PathCountPart1(paths, visitedSmallCaves, a);
|
count += PathCountPart1(paths, visitedSmallCaves, a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -58,8 +56,7 @@ long PathCountPart2(Dictionary<string, ImmutableHashSet<string>> paths, Immutabl
|
||||||
foreach (var a in adjacent) {
|
foreach (var a in adjacent) {
|
||||||
if (a.ToLower() == a) {
|
if (a.ToLower() == a) {
|
||||||
count += PathCountPart2(paths, visitedSmallCaves.Add(a), a, twice || visitedSmallCaves.Contains(a));
|
count += PathCountPart2(paths, visitedSmallCaves.Add(a), a, twice || visitedSmallCaves.Contains(a));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
count += PathCountPart2(paths, visitedSmallCaves, a, twice);
|
count += PathCountPart2(paths, visitedSmallCaves, a, twice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue