21 lines
437 B
Python
21 lines
437 B
Python
lines = (x.strip() for x in open("input.txt"))
|
|
|
|
high = 0
|
|
|
|
|
|
def parse_binary_string(string: str, ones):
|
|
length = len(string) - 1
|
|
cnt = 0
|
|
for idx, val in enumerate(string):
|
|
cnt += 2 ** (length-idx) if val == ones else 0
|
|
return cnt
|
|
|
|
|
|
for line in lines:
|
|
row = parse_binary_string(line[:7], ones="B")
|
|
col = parse_binary_string(line[7:], ones="R")
|
|
num = row * 8 + col
|
|
high = max(num, high)
|
|
|
|
print(high)
|