This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import itertools | |
from base64 import b64encode | |
from retrie.trie import Trie | |
def commonise_group(pat): | |
patr = list(sorted(''.join(reversed(s)) for s in pat)) | |
common = [patr[0]] | |
pat_map = {} |