Not sure where i went wrong, but it gives me [-1, [-2, [-3, []]]]
instead of just [-1,-2,-3]
def search(list1,list2):
if list2 == []:
return list1
elif list2[0] == list1[0]:
return [-list1[0] , search(list1[1:],list2[1:])]
print search([1,2,3],[1,2,3])