Key Pair
Problem :
https://practice.geeksforgeeks.org/problems/key-pair/0
Solution
Problem :
https://practice.geeksforgeeks.org/problems/key-pair/0
Solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#code | |
T=int(input())#Test cases | |
for t in range(0,T):#looping through all test cases | |
N_X = [int(x) for x in input().split()] | |
flag=0 | |
A=[int(y) for y in input().split()]#read elements separated by space | |
for a in range(N_X[0]): | |
if N_X[1]-A[a] in A:#if number complement found in A[] print yes | |
print("Yes") | |
flag=1 | |
break | |
if(flag==0): | |
print("No") |
No comments:
Post a Comment