AdventOfCode/AdventOfCode.Solutions/2022/Day 05/Day05Part1.cs
Rob 3846b42b7e Massive code base change
partial completion of day 3
2023-12-03 19:09:26 +01:00

25 lines
800 B
C#

using AdventOfCode.Solutions._2022.Day_05;
namespace AdventOfCode.Solutions._2022
{
public class Day05Part1 : Answerable
{
public override int Year { get; set; } = 2022;
public override int Day { get; set; } = 5;
public override int Part { get; set; } = 1;
public override string GetAnswer(byte[] data)
{
string[] initAndInstructions = GetAsString(data).Split(NewLine + NewLine);
CraneWork work = new CraneWork();
work.ReadInitialContainerArrangement(initAndInstructions[0].Split(NewLine));
foreach (string instruction in initAndInstructions[1].Split(NewLine))
{
work.DoCraneWork(instruction);
}
return work.GetTopContainers();
}
}
}