测试评估
| 指标 | 结果 |
|---|---|
| Base 测试 | PASS |
| Plus 测试 | PASS |
| 代码长度 | 585 字符 |
模型生成的代码 (585 字符)
def max_difference(pairs):
"""
Find the maximum absolute difference between the two elements
in each tuple from the given list of pairs.
Args:
pairs (list of tuple): A list of 2-element tuples.
Returns:
int: The maximum absolute difference across all pairs.
"""
# Compute the absolute difference for each pair and return the maximum.
# If the list is empty, max() will raise a ValueError; we can handle it
# if needed, but the problem statement does not specify empty input.
return max(abs(a - b) for a, b in pairs)
Base 失败测试用例
- 无失败测试
Plus 失败测试用例
- 无失败测试