(s)
| 27 | choices = ["A", "B", "C", "D"] |
| 28 | |
| 29 | def find_valid_substrings(s): |
| 30 | # 匹配长度为1到4的、不包含重复字符的子串 |
| 31 | pattern = r'[ABCD]{1,4}' |
| 32 | substrings = re.findall(pattern, s) |
| 33 | # 过滤出不包含重复字符的子串 |
| 34 | valid_substrings = [substring for substring in substrings if len(substring) == len(set(substring))] |
| 35 | return valid_substrings |
| 36 | |
| 37 | def format_subject(subject): |
| 38 | l = subject.split("_") |