mirror of
https://github.com/Xevion/advent-of-code.git
synced 2025-12-08 04:06:24 -06:00
day 3 part 1
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user