Solve 5.1 and 5.2
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
|
||||
with open("input") as f:
|
||||
data = f.read().strip().split("\n")
|
||||
|
||||
seats = [int(s.replace("F", "0").replace("B", "1").replace("L", "0").replace("R", "1"), base=2)
|
||||
for s in data]
|
||||
print(max(seats))
|
||||
print([(a+b)//2 for a, b in zip(sorted(seats), sorted(seats)[1:]) if b-a>1][0])
|
||||
Reference in New Issue
Block a user