can u please explain the complexity ??? while loop inside the for loop but stack exists in between ?
arr=[1,3,4,7,10]

target=5

stack=[]

ans=[]

stack.append(arr[0])

for i in range(len(arr)-1):
     a=stack.pop()
     j=i+1

    while j<=len(arr)-1:
	if a+arr[j]<target:
	ans.append([a+arr[j],a,arr[j]])

    j+=1

stack.append(arr[i+1])

a=(max(ans))

print(a[1],a[2])

#NOT SURE ABOUT COMPLEXITY

## ***can u please explain the complexity ….. while loop inside the for loop but stack exists in between***
Comments (1)