测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | FAIL |
| 代码长度 | 313 字符 |
模型生成的代码 (313 字符)
def find_Parity(x: int) -> bool:
"""
Returns True if the parity of the given number is odd
(i.e., the number of 1-bits is odd), False otherwise.
"""
# Count the number of set bits using XOR reduction
parity = 0
while x:
parity ^= (x & 1)
x >>= 1
return bool(parity)
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
[-10]