day 3 part 1

This commit is contained in:
Xevion
2019-07-25 16:37:51 -05:00
parent a86f66c41a
commit d8ea513a3e
4 changed files with 1385 additions and 3 deletions

View File

@@ -1,10 +1,10 @@
import os, sys, pyperclip
def count(string):
return [string.count(k) for k in list(set(string))]
return list(set([string.count(k) for k in list(set(string))]))
path = os.path.join(sys.path[0], '..', 'input')
data = open(path, 'r').read().split()
data = open(path, 'r').read().split('\n')
data = sum(map(count, data), [])
two, three = data.count(2), data.count(3)