This problem is in Contest(s) below:
Contest 1634:[算法]字符串
Contest 1004:17lx寒假作业