25 lines
406 B
Python
25 lines
406 B
Python
from lib import get_data
|
|
|
|
|
|
def part_1(data):
|
|
r1, r2 = 0, 0
|
|
for group in data.split("\n\n"):
|
|
r1 += len(set(group.replace("\n", "")))
|
|
|
|
s = set(group.splitlines()[0])
|
|
for line in group.splitlines():
|
|
s &= set(line)
|
|
r2 += len(s)
|
|
|
|
print(r1)
|
|
print(r2)
|
|
|
|
|
|
def main():
|
|
data = get_data(__file__)
|
|
part_1(data)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|