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