diff --git a/2021/8/main2.py b/2021/8/main2.py index 1f88d69..3b2485c 100644 --- a/2021/8/main2.py +++ b/2021/8/main2.py @@ -82,7 +82,7 @@ def ParsePossibilities(text): # RemoveImpossibleLetters(good_letters, good_positions) # The harder ones second: - if(text_len == 5): + # if(text_len == 5): # Could be 2, 3, or 5 # MUST contain positions 'a', 'd', and 'g' in any 5-position number # MIGHT contain positions 'b' and 'f' for FIVE @@ -91,7 +91,7 @@ def ParsePossibilities(text): # if one of them is found with two others, it's either c or f # if one of them is not found with two others, it could be b or e - if(text_len == 6): + # if(text_len == 6): # Could be 0, 6, or 9 # MUST contain positions 'a', 'b', 'f', and 'g' in any 6-position number # MIGHT contain positions 'c' and 'd' for NINE @@ -108,6 +108,7 @@ with open('example_data', 'r') as fp: data = split_line[0].split() # print(data) codes = split_line[1] + data += codes for val in codes.split(): if(len(val) in [2, 3, 4, 7]): total += 1