From 5eb10f931c85a0612502d137b129d41bf255d875 Mon Sep 17 00:00:00 2001 From: Jake Date: Mon, 5 Dec 2022 21:59:23 +0000 Subject: [PATCH] Fix bug when first stack is not the largest --- 2022/Day-05/day01-1.py | 2 +- 2022/Day-05/day01-2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/2022/Day-05/day01-1.py b/2022/Day-05/day01-1.py index b0b46ac..3749095 100644 --- a/2022/Day-05/day01-1.py +++ b/2022/Day-05/day01-1.py @@ -31,7 +31,7 @@ with open('input.txt', 'r') as inputFile: rawStacks.append([]) for line in inputFile: - if(line[0] != '['): + if('[' not in line[0]): break for i in range(len(stackIndex)): if(stackIndex[i].isdigit() and line[i] != ' '): diff --git a/2022/Day-05/day01-2.py b/2022/Day-05/day01-2.py index dcec612..9b69f98 100644 --- a/2022/Day-05/day01-2.py +++ b/2022/Day-05/day01-2.py @@ -31,7 +31,7 @@ with open('input.txt', 'r') as inputFile: rawStacks.append([]) for line in inputFile: - if(line[0] != '['): + if('[' not in line[0]): break for i in range(len(stackIndex)): if(stackIndex[i].isdigit() and line[i] != ' '):