Add day 14

This commit is contained in:
2022-12-16 22:14:50 +01:00
parent 331d064f66
commit 0dfc6b59de
3 changed files with 583 additions and 2 deletions

View File

@@ -10,11 +10,16 @@ public static class EnumerableExtensions
while (toVisit.TryPop(out var node))
{
yield return node;
foreach (var child in flattener(node))
{
toVisit.Push(child);
}
}
}
public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue)
{
return dictionary.TryGetValue(key, out var value) ? value : defaultValue;
}
}