We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
t = int(input())
i = 0
while i in range(t):
set_a = int(input())
set_a_list = set(list(input().split()))
set_b = int(input())
set_b_list = set(list(input().split()))
print(set_a_list.issubset(set_b_list))
i += 1
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Check Subset
You are viewing a single comment's thread. Return to all comments →
simple logic
t = int(input()) i = 0 while i in range(t):
set_a = int(input()) set_a_list = set(list(input().split())) set_b = int(input()) set_b_list = set(list(input().split())) print(set_a_list.issubset(set_b_list)) i += 1