From bb297500ef5b45c7d3bd7810664e3cb3eb5953d1 Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 8 Dec 2021 07:35:50 +0000 Subject: [PATCH] Completed day 8, task 1 --- Day-8/day8-1.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Day-8/day8-1.py diff --git a/Day-8/day8-1.py b/Day-8/day8-1.py new file mode 100644 index 0000000..2b5621f --- /dev/null +++ b/Day-8/day8-1.py @@ -0,0 +1,12 @@ +#!/usr/bin/python3 + +totalUnique = 0 + +# Read in the input file. +with open('/home/jake/Documents/AoC-2021/Day-8/input.txt') as inputFile: + for line in inputFile: + for output in line.strip('\n').split('|')[1].split(): + if(len(output) in [2,3,4,7]): + totalUnique += 1 + +print(totalUnique) \ No newline at end of file