🔎 CRUXEval Sample Explorer 🔎

CRUXEval is a benchmark complementary to HumanEval and MBPP measuring code reasoning, understanding, and execution capabilities!


   
def f(arr): 
    counts = [0] * 9 
    ans = [] 
    for ele in arr: counts[ele - 1] += 1 
    for i in range(len(counts)): 
        while counts[i] > 0: 
            counts[i] -= 1 
            ans.append(i + 1)
    return counts, ans
assert f([6, 3, 0, 7, 4, 8]) == ([0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 4, 6, 7, 8, 9])
CRUXEval-I
assert f(??) == ([0, 0, 0, 0, 0, 0, 0, 0, 0], [3, 4, 6, 7, 8, 9])

CRUXEval-O
assert f([6, 3, 0, 7, 4, 8]) == ??