Day2 fix - thank you elly
parent
0aa8bb80ba
commit
30a1293932
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue