25 lines
800 B
C#
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();
|
|
}
|
|
}
|
|
}
|