This problem is in Contest(s) below:
Contest 1501:字符串相关算法
Contest 1499:YC_2021_3月
Contest 1498:hash