given an array A and a integer B. A pair(i,j) in the array is a good pair if i!=j and (A[i]+A[j]==B).check if any good pair exist or not.
input A=[1,2,3,4]
output-1
sir i do it by bruteforce but i am not getting how to optimise it so please tell how i can optimise our code and thinking