No Idea!

Sort by

recency

|

1487 Discussions

|

  • + 0 comments

    n,m=input().split()

    arr=list(map(int, input().split()))

    a1=list(map(int, input().split()))

    a=set(a1)

    b1=list(map(int, input().split()))

    b=set(b1)

    happiness=0

    for i in range(int(n)):

    if arr[i] in a:
        happiness=happiness+1
    

    for i in range(int(n)):

    if arr[i] in b:
        happiness=happiness-1
    

    print(happiness)

  • + 0 comments

    why is everyone converting input to integer when string will also do the same

    input()
    a = input().split()
    h = set(input().split())
    s = set(input().split())
    print(sum(1 if x in h else -1 if x in s else 0 for x in a))
    
  • + 0 comments

    n, m = map(int, input().split())
    array = list(map(int, input().split()))
    A = set(map(int, input().split()))
    B = set(map(int, input().split()))

    happiness = 0 for num in array: if num in A:
    happiness += 1 elif num in B:
    happiness -= 1

    print(happiness)

  • + 0 comments
    1. n = map(int,input().split())
    2. n_int = list(map(int,input().split()))
    3. m_a = set(map(int,input().split()))
    4. m_b = set(map(int,input().split()))
    5. happiness = 0
    6. for i in n_int:
    7. if(i in m_a):
    8. happiness+=1
    9. elif(i in m_b):
    10. happiness -=1
    11. print(happiness)
  • + 0 comments
    input()
    
    nums = {}
    for num in input().split():
        nums[num] = nums.get(num, 0) + 1
    
    current_mood = 0
    
    for n in input().split():
        current_mood += nums.get(n, 0)
    
    for n in input().split():
        current_mood -= nums.get(n, 0)
    
    print(current_mood)