diff options
-rw-r--r-- | 12.py | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -29,9 +29,9 @@ for line in stdin: print(sum(matching(pattern, groups, len(pattern)) for pattern, groups in inp)) - -p2 = 0 -for pattern, groups in inp: - pattern = "?".join([pattern] * 5) - p2 += matching(pattern, groups * 5, len(pattern)) -print(p2) +print( + sum( + matching("?".join([pattern] * 5), groups * 5, len(pattern) * 5 + 4) + for pattern, groups in inp + ) +) |