Set .union() Operation

Sort by

recency

|

791 Discussions

|

  • + 0 comments
    n = int(input())
    set_eng = set(map(int, input().split()))
    
    b = int(input())
    set_fre = set(map(int, input().split()))
    
    final_set = set_eng.union(set_fre)
    
    print(len(final_set))
    
  • + 0 comments

    Here is HackerRank Set .union() Operation in python solution - https://programmingoneonone.com/hackerrank-set-union-operation-solution-in-python.html

  • + 0 comments

    english = int(input()) roll_english= set(map(int, input().split())) franch= int(input()) roll_franch = set(map(int, input().split())) print(len(roll_english.union(roll_franch)))

  • + 0 comments
    m=input()
    l=set(map(int,input().split()))
    n=input()
    s=set(map(int,input().split()))
    print(len(s.union(l)))
    
  • + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    n1 = int(input())
    set1 = set(map(int,input().split()))
    n2 = int(input())
    set2 = set(map(int,input().split()))
    print(len(set1.union(set2)))