You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
386 B
20 lines
386 B
import numpy as np
|
|
|
|
file = "inputs/day8.input"
|
|
numbers = [
|
|
x.decode().split("|")[1].replace("\n", "") for x in open(file, "rb").readlines()
|
|
]
|
|
|
|
|
|
def count(l):
|
|
counter = 0
|
|
for string in l:
|
|
substring = string.split(" ")
|
|
for cypher in substring:
|
|
if len(cypher) in [2, 3, 4, 7]:
|
|
counter += 1
|
|
return counter
|
|
|
|
|
|
print(count(numbers))
|