No Idea!

Sort by

recency

|

1509 Discussions

|

  • + 0 comments

    n, m = input().split(" ") arr = [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(" ")])

    sums = [] for i in arr: if i in a: sums.append(1) elif i in b: sums.append(-1) print(sum(sums))

  • + 0 comments
    from functools import reduce
    
    n, m = map(int, input().split())
    array = map(int, input().split())
    a = set(map(int, input().split()))
    b = set(map(int, input().split()))
    
    print(reduce(
        lambda x, y: (x + 1) if y in a else x - 1 if y in b else x,
        array,
        0
        ))
    
  • + 0 comments
    n, m= input().split()
    arr= input().split()
    A= set(input().split())
    B= set(input().split())
    
    Score_A= len([element for element in arr if element in A])
    Score_B= len([element for element in arr if element in B])
    
    total_happiness= Score_A - Score_B
    print(total_happiness)
    
  • + 0 comments

    n,m = input().split() n_arr = input().split() a = set(input().split()) b = set(input().split())

    def happiness(): h =0 for i in n_arr: if i in a: h+=1 elif i in b: h-=1 else: h=h return h print(happiness())

  • + 0 comments

    N,M=map(int,input().split()) l=list(map(int,input().split())) s1=set(map(int,input().split())) s2=set(map(int,input().split())) hapiness=0 for i in l: if i in s1: hapiness += 1 elif i in s2: hapiness -= 1

    print(hapiness)