Fix bug when first stack is not the largest

This commit is contained in:
2022-12-05 21:59:23 +00:00
parent bafca07a3c
commit 5eb10f931c
2 changed files with 2 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ with open('input.txt', 'r') as inputFile:
rawStacks.append([]) rawStacks.append([])
for line in inputFile: for line in inputFile:
if(line[0] != '['): if('[' not in line[0]):
break break
for i in range(len(stackIndex)): for i in range(len(stackIndex)):
if(stackIndex[i].isdigit() and line[i] != ' '): if(stackIndex[i].isdigit() and line[i] != ' '):

View File

@@ -31,7 +31,7 @@ with open('input.txt', 'r') as inputFile:
rawStacks.append([]) rawStacks.append([])
for line in inputFile: for line in inputFile:
if(line[0] != '['): if('[' not in line[0]):
break break
for i in range(len(stackIndex)): for i in range(len(stackIndex)):
if(stackIndex[i].isdigit() and line[i] != ' '): if(stackIndex[i].isdigit() and line[i] != ' '):