common (humaneval-loki-solutions/58.py)

agentic-awesome-skills · plugins/agentic-awesome-skills-claude/skills/loki-mode/benchmarks/results/humaneval-loki-solutions/58.py · python · MIT
testing, tag:knn-classified

Python function returning sorted unique common elements between two lists.

# Source: https://github.com/sickn33/agentic-awesome-skills | License: MIT | Copyright 2026 Antigravity User
# Provided via justclaw.it.com; keep this notice with the code.
# HumanEval/58
# Loki Mode Multi-Agent Solution
# Attempts: 1
# Passed: True

def common(l1: list, l2: list):
    """Return sorted unique common elements for two lists.
    >>> common([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121])
    [1, 5, 653]
    >>> common([5, 3, 2, 8], [3, 2])
    [2, 3]

    """
    return sorted(set(l1) & set(l2))

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key