Set .union() Operation

Sort by

recency

|

762 Discussions

|

  • + 0 comments

    n = int(input()) students = set(map(int, input().split())) b = int(input()) be = set(map(int, input().split()))

    print(len(students | be))

  • + 0 comments
    n = int(input())
    nE = set(map(int, input().split()))
    
    b = int(input())
    bF = set(map(int, input().split()))
    
    print(len(nE | bF))
    
  • + 0 comments

    Here's my code:

    el = int(input())
    e = set(list(map(int, input().split()))[:el])
    fl = int(input())
    f = set(list(map(int, input().split()))[:fl])
    print(len(e.union(f)))
    
  • + 0 comments

    english = int(input()) english_std = set(list(map(int, input().split()))) france = int(input()) france_std = set(list(map(int, input().split()))) print(len(english_std.union(france_std)))

  • + 0 comments
    n = int(input())
    e = set(map(int, input().split()))
    m = int(input())
    f = set(map(int, input().split()))
    print(len(e.union(f)))