Add day 14
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user