diff --git a/2017/09/solution.py b/2017/09/solution.py index b21fec0..56d23c8 100644 --- a/2017/09/solution.py +++ b/2017/09/solution.py @@ -4,7 +4,7 @@ from pprint import pprint input_f = 'input' -part = -1 +part = 2 ######################################### # # # Part 1 # @@ -29,8 +29,17 @@ if part == 1: ######################################### # # -# Part 2 # +# not working Part 2 # # # ######################################### if part == 2: - exit() + with open(input_f) as file: + for line in file: + print(line.rstrip(), end=' ') + clean_string = line.rstrip() + clean_string = re.sub(r"!.",'',clean_string) + print(clean_string) + clean_string = re.findall(r"<.*?>", clean_string) + for c in clean_string: + clean_string = c.replace('<','',1).replace('>','',1) + print(len(clean_string)) diff --git a/2017/09/test2 b/2017/09/test2 new file mode 100644 index 0000000..7a8fbc2 --- /dev/null +++ b/2017/09/test2 @@ -0,0 +1,7 @@ +<> + +<<<<> +<{!>}> + +> +<{o"i!a,<{i