public override void PartTwo() { var half = InputLine.Length / 2; var captcha = new CircularBuffer <int>(InputLine.Digits().ToArray()); var result = captcha.Select((d, i) => d == captcha[i + half] ? d : 0).Sum(); WriteLn(result); }
public override void PartOne() { var result = InputLine.Digits().Again(1).Pairwise((a, b) => a == b ? a : 0).Sum(); WriteLn(result); }