Editorial for Intersection of Lists


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: wadeyao

T = int(input())
results = []
for t in range(T):
    nums1 = [int(s) for s in input().split()]
    nums2 = [int(s) for s in input().split()]
    intsct = list(set(nums1).intersection(set(nums2)))
    intsct.sort()
    print(f'Case #{t+1}: {intsct}')

Comments

There are no comments at the moment.