Cleanup
This commit is contained in:
@@ -57,7 +57,6 @@ for dont in re.finditer(dont_re, input):
|
||||
accumulator = 0
|
||||
enable = True
|
||||
while commands:
|
||||
#for index, cmd in commands:
|
||||
(index, cmd) = heapq.heappop(commands)
|
||||
if isinstance(cmd, MulCmd):
|
||||
print(f"mul: {cmd.l} * {cmd.r}")
|
||||
@@ -70,62 +69,3 @@ while commands:
|
||||
|
||||
print(accumulator)
|
||||
|
||||
#for mul in muls:
|
||||
# print(input[mul.span(0)[0]:mul.span(0)[1]])
|
||||
# print(input[mul.span(1)[0]:mul.span(1)[1]])
|
||||
# print(input[mul.span(2)[0]:mul.span(2)[1]])
|
||||
#print(mul.span(0))
|
||||
#print(mul.span(1))
|
||||
# accumulator += int(mul[0]) * int(mul[1])
|
||||
#
|
||||
#print(accumulator)
|
||||
|
||||
#i = 0
|
||||
#while True:
|
||||
#
|
||||
#
|
||||
#
|
||||
# print("\n\n")
|
||||
# a = input[i:].find("mul(")
|
||||
# a_mod = a + i
|
||||
# b = input[a_mod:].find(",")
|
||||
# b_mod = b + a_mod
|
||||
# c = input[a_mod:].find(")")
|
||||
# c_mod = c + a_mod
|
||||
# if a == -1:
|
||||
# break
|
||||
# if b == -1:
|
||||
# break
|
||||
# if c == -1:
|
||||
# break
|
||||
#
|
||||
# a = a_mod
|
||||
# b = b_mod
|
||||
# c = c_mod
|
||||
# print(input[i:])
|
||||
# print(input[a:])
|
||||
# print(input[b:])
|
||||
# print(input[c:])
|
||||
#
|
||||
# print(a, b, c)
|
||||
#
|
||||
#
|
||||
#
|
||||
# print(input[a+4:b])
|
||||
# print(input[b+1:c])
|
||||
# try:
|
||||
# val0 = int(input[a+4:b])
|
||||
# val1 = int(input[b+1:c])
|
||||
# except ValueError:
|
||||
# i = a + 4
|
||||
# continue
|
||||
# print(f"{val0=}")
|
||||
# print(f"{val1=}")
|
||||
#
|
||||
# accumulator += val0 * val1
|
||||
#
|
||||
# i = c + 1
|
||||
#
|
||||
#print(accumulator)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user