No Idea!

  • + 1 comment

    Enter your code here. Read input from STDIN. Print output to STDOUT

    Read a single line of input for n and m

    nm = input() # Example input: "3 2"

    Split the input line into parts and convert each to an integer

    n,m = map(int, nm.split())

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

    2sets: A: set, B:set each containing m integers

    A = set(map(int, input().split())) B = set(map(int, input().split()))

    happiness = 0

    for i in array: if i in A: happiness+=1 elif i in B: happiness -=1 else: happiness +=0 print(happiness)