buggy_code:
def two_sum(nums, target):
    seen = {}
    for i, num in enumerate(nums):
        complement = target - num
        if complement in seen:
            return [seen[complement], i]
        seen[num] = num
    return []

original_code:
def two_sum(nums, target):
    seen = {}
    for i, num in enumerate(nums):
        complement = target - num
        if complement in seen:
            return [seen[complement], i]
        seen[num] = i
    return []

initial_error: AssertionError: two_sum([2,7,11,15], 9) expected [0,1], got [2,1]


function_name: fibonacci

buggy_code:
def fibonacci(n):
    if n == 0:
        return 0
    return fibonacci(n - 1) + fibonacci(n - 2)

original_code:
def fibonacci(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)

initial_error: RecursionError: maximum recursion depth exceeded

function: fibonacci


function_name: flatten

buggy_code:
def flatten(lst):
    result = []
    for item in lst:
        if isinstance(item, list):
            result.append(flatten(item))
        else:
            result.append(item)
    return result

original_code:
def flatten(lst):
    result = []
    for item in lst:
        if isinstance(item, list):
            result.extend(flatten(item))
        else:
            result.append(item)
    return result

initial_error: AssertionError: flatten([[1,[2]],3]) expected [1,2,3], got [1,[2],3]

function: flatten