22 lines
625 B
C#
22 lines
625 B
C#
namespace AdventOfCodeLibrary._2022
|
|
{
|
|
using AdventOfCodeLibrary.Shared;
|
|
|
|
public class Day01Part1 : IAnswerable
|
|
{
|
|
public int Year { get; set; } = 2022;
|
|
public int Day { get; set; } = 1;
|
|
public int Part { get; set; } = 1;
|
|
|
|
public string GetAwner(byte[] data)
|
|
{
|
|
return ByteHelper.GetAsString(data).TrimEnd()
|
|
.Split(Environment.NewLine + Environment.NewLine)
|
|
.Select(s => s.Split(Environment.NewLine)
|
|
.Sum(Convert.ToInt32))
|
|
.MaxBy(v => v)
|
|
.ToString();
|
|
}
|
|
}
|
|
}
|