This commit is contained in:
Laura Hausmann 2022-12-01 16:04:56 +01:00
parent 8fc195943b
commit 3e6896dc6e
Signed by: zotan
GPG key ID: D044E84C5BE01605
2 changed files with 1 additions and 1 deletions

View file

@ -1,4 +1,4 @@
var input = File.ReadAllText("../../../../inputs/1_1.txt").TrimEnd('\n').Split("\n\n"); // Read input file, remove trailing newlines, split by double newline
var input = File.ReadAllText("../../../../inputs/1.txt").TrimEnd('\n').Split("\n\n"); // Read input file, remove trailing newlines, split by double newline
var elves = input.Select(s => new Elf(s.Split("\n").Select(int.Parse))); // Use LINQ magic (select) to transform the collection of strings into a collection of Elves
Console.WriteLine(elves.MaxBy(elf => elf.Total())!.Total()); // Output Elf with highest total number of calories