Cleaned up a bit.

This commit is contained in:
Andrew Lalis 2021-12-01 08:57:31 +01:00
parent 564c09511c
commit 8ca21fcdf4
1 changed files with 1 additions and 5 deletions

View File

@ -9,11 +9,7 @@ void slidingSum() {
int increaseCount = 0; int increaseCount = 0;
foreach (i; 1 .. (values.length - 2)) { foreach (i; 1 .. (values.length - 2)) {
int currentSum = values[i] + values[i + 1] + values[i + 2]; int currentSum = values[i] + values[i + 1] + values[i + 2];
bool increase = false; if (currentSum > previousSum) increaseCount++;
if (currentSum > previousSum) {
increaseCount++;
increase = true;
}
previousSum = currentSum; previousSum = currentSum;
} }
writefln("%d", increaseCount); writefln("%d", increaseCount);