def inNumAdd(array, n):

for i in range(len(array)):

for j in range(len(array)):

if int(array[i]) + int(array[j]) == k:

return True

return False

num_arr = input()

num_arr = num_arr.replace("[", “”).replace("]","").replace(" “, “”)

num_arr = num_arr.split(”,")

k = int(input())

print(inNumAdd(num_arr, k))

I wrote the code like this in response to the above question,

Can I get a better answer than O(n^2)?