7 lines
347 B
Python
7 lines
347 B
Python
from functools import reduce
|
|
from math import floor, ceil
|
|
shuffle = lambda l, h, s: reduce(lambda a, b: (a[0], floor((a[0]+a[1])/2)) if b in "FL" else (ceil((a[0]+a[1])/2), a[1]), s, (l, h))[0]
|
|
lines = [l for l in open("input", "r").read().split("\n") if l]
|
|
ids = [shuffle(0, 127, l[:7]) * 8 + shuffle(0, 7, l[7:]) for l in lines]
|
|
print(max(ids))
|