Day 14 (removed unnecessary string join)
This commit is contained in:
@@ -27,7 +27,7 @@ for line in lines:
|
|||||||
match = regex_mem.match(line)
|
match = regex_mem.match(line)
|
||||||
addr, dec = list(map(int, match.groups()))
|
addr, dec = list(map(int, match.groups()))
|
||||||
bin = format(addr, '036b')
|
bin = format(addr, '036b')
|
||||||
res = "".join((a if b == '0' else b) for a, b in zip(bin, mask))
|
res = [(a if b == '0' else b) for a, b in zip(bin, mask)]
|
||||||
for x in combination(res):
|
for x in combination(res):
|
||||||
mem[x] = dec
|
mem[x] = dec
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user