Mbpp/758

✅ 完美通过 Base: PASS Plus: PASS
测试评估
指标结果
Base 测试PASS
Plus 测试PASS
代码长度579 字符
模型生成的代码 (579 字符)
from typing import List, Dict, Tuple, Any
def unique_sublists(lst: List[List[Any]]) -> Dict[Tuple[Any, ...], int]:
    """
    Counts sublists in a list, converting each sublist to a tuple and using it as a dictionary key.

    Args:
        lst: A list containing sublists (assumed to be lists of any elements).

    Returns:
        A dictionary where keys are tuples representing the sublists and values are their frequencies.
    """
    count: Dict[Tuple[Any, ...], int] = {}
    for sub in lst:
        t = tuple(sub)
        count[t] = count.get(t, 0) + 1
    return count
Base 失败测试用例
  • 无失败测试
Plus 失败测试用例
  • 无失败测试