Set .union() Operation

Sort by

recency

|

768 Discussions

|

  • + 0 comments

    code

    input() english = set(input().split()) input() french = set(input().split())

    print(len(english.union(french)))

  • + 0 comments

    input() english_newspaper = set(input().split()) input() french_newspaper = set(input().split())

    print(len(english_newspaper.union(french_newspaper)))

  • + 0 comments

    n = int(input()) eng_sub = set(map(int, input().split()))

    m = int(input()) french_sub = set(map(int, input().split()))

    union_all = eng_sub.union(french_sub) print(len(union_all))

  • + 0 comments
    input()
    english = set(input().split())
    input()
    french = set(input().split())
    
    print(len(english.union(french)))
    
  • + 0 comments

    s= int(input()) set1=set(map(int,input().split(" "))) a= int(input()) set2=set(map(int,input().split(" "))) print(len(set1| set2))