Day2 fix - thank you elly

main
login000 2024-12-03 14:37:19 +10:30
parent 0aa8bb80ba
commit 30a1293932
1 changed files with 2 additions and 5 deletions

View File

@ -13,7 +13,6 @@ namespace Advent24
{
Int32 currentLevel;
Int32? previousLevel = null;
Int32? previousPreviousLevel = null;
Int32 differenceInLevels = 0;
Boolean? isIncreasing = null;
Boolean reportIsSafe = true;
@ -29,8 +28,7 @@ namespace Advent24
if((levelIndexToSkip ?? -1) == currentLevelIndex)
{
// assume current element doesn't exist, so the previous
// element should be the one that was before it
previousLevel = previousPreviousLevel;
// element should remain what it was
Console.WriteLine("{0:s} {1:d}", " currentLevelIndex (skipped) = ", currentLevelIndex);
@ -96,8 +94,7 @@ namespace Advent24
// control reaches this line if report has not been proven unsafe yet
// updating previousLevel and previousPreviousLevel in preparation for the next iteration
previousPreviousLevel = previousLevel;
// updating previousLevel in preparation for the next iteration
previousLevel = currentLevel;
// incrementing the current-element-number indicator