No Idea!

Sort by

recency

|

1525 Discussions

|

  • + 0 comments

    n, m = map(int, input().split(" "))

    my_list = list(map(int, input().split(" ")))

    set_a = set(map(int, input().split(" ")))

    set_b = set(map(int, input().split(" ")))

    happiness = 0

    for i in my_list:

    if i in set_a:
    
        happiness += 1
    
    elif i in set_b:
    
        happiness -= 1
    
    else:
        happiness
    

    print(happiness)

  • + 0 comments

    Is the Explaination wrong??

  • + 0 comments

    No need to convert the values to int.

  • + 0 comments
    n, m = list(map(int, input().split()))
    
    ints = [int(i) for i in input().split()]
    A = set([int(i) for i in input().split()])
    B = set([int(i) for i in input().split()])
        
    happines = 0
    
    for i in ints:
        if i in A:
            happines += 1
        elif i in B:
            happines -= 1
    
    print(happines)
    
  • + 0 comments
    n, m = map(int, input().split(" "))
    lst = list(map(int,input().split(' ')))
    A = set(map(int,(input().split(' '))))
    B = set(map(int,(input().split(' '))))
    
    happiness = 0
    for l in lst:
        if l in A:
            happiness +=1
        elif l in B:
            happiness -=1
    print(happiness)