Mbpp/772

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度600 字符
模型生成的代码 (600 字符)
def remove_length(s, k):
    """
    Remove all words with length k from the given string.
    
    Args:
        s (str): Input string containing words separated by spaces.
        k (int): Length of words to remove.
    
    Returns:
        str: String with words of length k removed, words joined by single spaces.
    """
    # Split the string into words by whitespace
    words = s.split()
    # Keep only words whose length is not equal to k
    filtered_words = [word for word in words if len(word) != k]
    # Join the remaining words with a single space
    return ' '.join(filtered_words)
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试