Skip to content

Commit

Permalink
day 8: no need to strip leading '+'
Browse files Browse the repository at this point in the history
  • Loading branch information
woranov committed Dec 8, 2020
1 parent 0492884 commit c96ca51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion day08/part1.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def compute(data):
visited.add(row)

op, num_s = data[row].split()
num = int(num_s.lstrip("+"))
num = int(num_s)

if op == "nop":
row += 1
Expand Down
2 changes: 1 addition & 1 deletion day08/part2.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def execute(ops, acc, row, visited, switched=False):
return acc

return execute(
ops=[(op, int(num_s.lstrip("+"))) for op, num_s in map(str.split, data)],
ops=[(op, int(num_s)) for op, num_s in map(str.split, data)],
acc=0,
row=0,
visited=set(),
Expand Down

0 comments on commit c96ca51

Please sign in to comment.