(s)
| 10 | choices = ["A", "B", "C", "D"] |
| 11 | |
| 12 | def find_valid_substrings(s): |
| 13 | # 匹配长度为1到4的、不包含重复字符的子串 |
| 14 | pattern = r'[ABCD]{1,4}' |
| 15 | substrings = re.findall(pattern, s) |
| 16 | # 过滤出不包含重复字符的子串 |
| 17 | valid_substrings = [substring for substring in substrings if len(substring) == len(set(substring))] |
| 18 | return valid_substrings |
| 19 | |
| 20 | def format_subject(subject): |
| 21 | l = subject.split("_") |