diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-12-02 09:30:07 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-12-02 09:30:07 +0100 |
commit | 2c1dccf57d7ad5e25e79063dea41fd7bfa9d9ac6 (patch) | |
tree | 6c36355ef1a475f2b7cf388402afc96a16588d3d /7b.py | |
parent | 2d02f553aa4cc4ded630628eccdf34f55937cee5 (diff) |
Move 2016 to its own folder
Diffstat (limited to '7b.py')
-rwxr-xr-x | 7b.py | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -1,23 +0,0 @@ -#!/usr/bin/env python3 - -import sys - -count=0 - -for line in sys.stdin: - line=line[:-1].replace("]","[").split("[") - p1=line[0::2] - p2=line[1::2] - p2bab=set() - - for bl in p2: - for i in range(len(bl)-2): - if bl[i]==bl[i+2] and bl[i]!=bl[i+1]: - p2bab.add(bl[i:i+3]) - - for bl, i in ((bl,i) for bl in p1 for i in range(len(bl)-2)): - if bl[i]==bl[i+2] and bl[i]!=bl[i+1] and "".join([bl[i+1],bl[i],bl[i+1]]) in p2bab: - count+=1 - break - -print(count) |