测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | FAIL |
| Plus 测试 | FAIL |
| 代码长度 | 484 字符 |
模型生成的代码 (484 字符)
def reverse_vowels(s: str) -> str:
"""
Reverses only the vowels in the given string.
The letter 'y' is not considered a vowel.
"""
vowels = set("aeiouAEIOU")
chars = list(s)
left, right = 0, len(chars) - 1
while left < right:
if chars[left] not in vowels:
left += 1
elif chars[right] not in vowels:
right -= 1
else:
chars[left], chars[right] = chars[right], chars[left]
left += 1
Base 失败测试用例
['Python']
Plus 失败测试用例
['']