Mbpp/57

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度669 字符
模型生成的代码 (669 字符)
def find_Max_Num(digits):
    """
    Returns the largest integer that can be formed by arranging the given digits.
    
    Args:
        digits (list of int): A list of single-digit non-negative integers (0-9).
    
    Returns:
        int: The maximum possible number formed by concatenating the digits.
    """
    # Sort the digits in descending order to form the largest number
    sorted_digits = sorted(digits, reverse=True)
    # Concatenate the sorted digits into a string and convert to an integer
    # Using int() naturally handles cases like [0, 0] -> "00" -> 0
    result = int(''.join(map(str, sorted_digits))) if sorted_digits else 0
    return result
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试