Code formatting and warning fixing.

This commit is contained in:
2024-12-01 17:36:23 +01:00
parent 9f8d966b7a
commit dafd2526d1
93 changed files with 739 additions and 823 deletions

View File

@@ -164,15 +164,15 @@ public class Day09 : IDay
return newLastNumber;
}
public long ExtrapolatePast()
{
_derivatives.Last().Insert(0,0);
_derivatives.Last().Insert(0, 0);
for (int i = _derivatives.Count - 2; i >= 0; i--)
{
long firstDerivative1 = _derivatives[i].First();
long firstDerivative0 = _derivatives[i + 1].First();
_derivatives[i].Insert(0,firstDerivative1 - firstDerivative0);
_derivatives[i].Insert(0, firstDerivative1 - firstDerivative0);
}
long firstNumber = _numbers.First();
long firstDerivative = _derivatives[0].First();