This problem is in Contest(s) below:
Contest 1068:2023-WE 百题大战08:字符和字符串处理
Contest 1036:Python-第4章-字符串
Contest 1073:Python初中级-APTIV-C-字符串