Cleaned up a bit.
This commit is contained in:
parent
564c09511c
commit
8ca21fcdf4
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue