You are viewing a single comment's thread. Return to all comments →
T = int(input()) for i in range(T): ele_A = int(input()) A = set(map(int, input().split())) ele_B = int(input()) B = set(map(int, input().split())) comm = list(A.intersection(B)) flag = False if len(comm) == len(A): flag = True if len(comm) == 0: flag = False else: for digit in comm: if digit not in B: flag = False break print(flag) else: print(flag)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Check Subset
You are viewing a single comment's thread. Return to all comments →