Add day 2

This commit is contained in:
2022-12-05 13:35:24 +01:00
parent 2dfe5d1bb5
commit 6e55404b19
3 changed files with 2613 additions and 5 deletions

17
StringExtensions.cs Normal file
View File

@@ -0,0 +1,17 @@
namespace AdventOfCode;
public static class StringExtensions
{
public static IEnumerable<string> ReadAllLines(this StringReader reader)
{
while (reader.ReadLine() is { } line)
{
yield return line;
}
}
public static IEnumerable<string> ReadAllLines(this string text)
{
return new StringReader(text).ReadAllLines();
}
}