Created
December 5, 2020 17:48
-
-
Save kung-foo/c8420d379a68a8c26f98bbd06bf4dca2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import random | |
src = open("input.txt", "r").readlines() | |
src = [r.strip() for r in src] | |
ids = set() | |
for line in src: | |
v = int(line.replace("B", "1").replace("F", "0").replace("R", "1").replace("L", "0"), 2) | |
ids.add(v) | |
print(max(ids)) | |
not_mine = set() | |
[not_mine.add(x) for x in range(min(ids), max(ids) + 1)] | |
print(not_mine.difference(ids)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment