Date: 18 July, 2023
Model: gpt-3.5-turbo
Temperature: 0.2
Passing runs: 10
Total runs: 10
Success rate: 100%
Tokens: 140
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]
"""
The above is an incomplete Python code fragment. Return the complete and correct code with no additional text.
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]
"""ret = set()
for e1 in l1:
for e2 in l2:
if e1 == e2:
ret.add(e1)
return sorted(list(ret))
METADATA = {}
def check(candidate):
assert candidate([1, 4, 3, 34, 653, 2, 5], [5, 7, 1, 5, 9, 653, 121]) == [1, 5, 653]
assert candidate([5, 3, 2, 8], [3, 2]) == [2, 3]
assert candidate([4, 3, 2, 8], [3, 2, 4]) == [2, 3, 4]
assert candidate([4, 3, 2, 8], []) == []
Start time: 2023-07-18 17:19:18
Duration: 4.77s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:19:14
Duration: 4.67s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:19:09
Duration: 4.57s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:19:04
Duration: 4.78s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:18:59
Duration: 4.7s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:18:54
Duration: 4.94s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:18:51
Duration: 3.67s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:18:46
Duration: 4.95s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:18:41
Duration: 5.0s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))
Start time: 2023-07-18 17:18:36
Duration: 4.65s
Completion tokens: 121
Result: Pass
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(list(set(l1) & set(l2)))