completes day 3 part 1.
This commit is contained in:
@@ -297,4 +297,4 @@ TgbpGblWlMsjgWlgMfpNRgbRHHBnHHHtLpCJPCPBnBLJtQQL
|
||||
sbTlblTlvRbbGblbFcdDzccVcDVvzzzd
|
||||
zMzfzlGwSBMMSCMzhsPgfcPcfcbhjQPt
|
||||
FHHqJVdJmFmdVrJdJppthscjGtqRPRcccgcQbR
|
||||
rvNJJpLrvvLnJvNFFvZZZBWznBWGSDCMnCwz
|
||||
rvNJJpLrvvLnJvNFFvZZZBWznBWGSDCMnCwz
|
||||
@@ -37,15 +37,21 @@ priorityValue = {
|
||||
}
|
||||
|
||||
for line in input:
|
||||
print("Line: " + line)
|
||||
lineLength = len(line) - 1
|
||||
print("Length of line: " + str(lineLength))
|
||||
lineLength = int(lineLength / 2)
|
||||
print("Line Length: " + str(lineLength))
|
||||
pack1 = line[:lineLength]
|
||||
print("Pack 1: " + pack1)
|
||||
pack2 = line[lineLength:]
|
||||
print("Pack 2: " + pack2)
|
||||
dupItem = ""
|
||||
for item in pack1:
|
||||
if (pack2.__contains__(item)):
|
||||
dupItem = item
|
||||
print(dupItem)
|
||||
# print(dupItem)
|
||||
break
|
||||
total += determinePriority(dupItem)
|
||||
|
||||
print(total)
|
||||
Reference in New Issue
Block a user