测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 408 字符 |
模型生成的代码 (408 字符)
def find_Rotations(s: str) -> int:
"""
Returns the minimum number of left rotations (> 0) required to get the same string.
This is equivalent to finding the smallest period of the string.
"""
n = len(s)
# Try rotations from 1 to n
for k in range(1, n + 1):
# Rotate left by k: s[k:] + s[:k]
if s == s[k:] + s[:k]:
return k
# Should never reach here
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试