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pt45YpAA8NdUAg9ngolTFNbedtqWi0avVicv5bLKFr2kSRltHaahrXCnylZcd6k208rDy4ItxlkUr5+XnZE1zxq0h3KfUQqv1GWsxeI0tHKY1rPtjRgVivKZU7HebrS491ybX+TWnO7V7PEn7w+f0rpPhb9zdxt7Rj3szkx/n/AI6+n88f4vTyebno8Wr3qTGvun7mawSxzsbNC4Pje0Oa9pqCD2grv+3z0zUi9Ji1bRrEx2wjtqzWdJ5wqq8pEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQU
规格:
patternABC >= 2 characters = groupABC IF groupABC occurs more than once
groupABC + (groupABC)n = sequence WHERE n >= 1 AND sequence > 6 characters
** 一个序列需要大于 6 个字符才能被评估
分解:
如何找到按顺序出现的任何重复模式?
QEBAQEBAQEBAQEBAQEBAQEBA
我还想计算每组重复多少次:
QEBA QEBA QEBA QEBA QEBA QEBA = 6
此外,该序列必须大于 6 个字符才能进行评估:
NO GOOD: AA AA AA
GOOD: AA AA AA AA
如果输出可以存储在关联数组中,并且删除重复条目,那将是理想的:
QEBA => 6, AA => 4, QEBA => 3, AA => 8, (QEBA => 6)<- REMOVE
有没有人有时间和意愿来解决这个问题?如果你这样做,你会摇滚!