示例#1
0
def interlock(l):
    for i in l:
        x = y = ''
        if (len(i)%2 == 0):
            for j in range(len(i)):
                if j%2 == 0:
                    x += i[j]
                else:
                    y += i[j]
        if (ex_10_11.bisect(l, x) != -1) and (ex_10_11.bisect(l, y) != -1):
            print x, y, i
示例#2
0
def interlock3(l):
    for i in l:
        x = y = z = ''
        if (len(i)%3 == 0):
            for j in range(len(i)):
                if j%3 == 0:
                    x += i[j]
                elif j%3 == 1:
                    y += i[j]
                else:
                    z += i[j]
        if (ex_10_11.bisect(l, x) != -1) and (ex_10_11.bisect(l, y) != -1) and (ex_10_11.bisect(l, z) != -1):
            print x, y, z, i
示例#3
0
def reverse_pair(l):
    c = 0
    for i in l:
        s = i[::-1]
        if ex_10_11.bisect(l, s) != -1:
            c += 1
            print i, s
    print c