def getSplit(string): count = 0 block = setOfBlocks(string) for item in block: if len(block)!= 0: count+=1 return count
def isValid(block): blocks = setOfBlocks(block) check = False for item in blocks: if len(item)>=2: return True return check
def reformat(block): blocks=setOfBlocks(block) res=[] for item in blocks: if len(item) > 0: res.append(''.join(sorted(item))) return '|'.join(res)
def getDuplication(string): dup = set() block = setOfBlocks(string) for item in block: dic = {} for letter in item: if letter not in dic: dic[letter]=1 else: dup.add(letter) return dup