Mbpp/63

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
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 失败测试用例
  • 无失败测试