测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 277 字符 |
模型生成的代码 (277 字符)
def check(n: int) -> bool:
"""
Returns True if the given number is one less than twice its reverse.
Otherwise returns False.
"""
# Handle edge case: reverse of a single digit is itself, but works fine.
rev = int(str(n)[::-1])
return n == 2 * rev - 1
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试