No Idea!

Sort by

recency

|

1504 Discussions

|

  • + 0 comments

    n,m = map(int, input().split()) list1 = list(map(int, input().split())) set1 = set(map(int, input().split())) set2 = set(map(int, input().split())) happ = 0

    happ = sum((i in set1) - (i in set2) for i in list1)

    print(happ)

  • + 0 comments

    Here is HackerRank No Idea! in python solution - https://programmingoneonone.com/hackerrank-no-idea-problem-solution-in-python.html

  • + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    n,m = map(int,input().split())
    array_n = list(map(int,input().split()))
    set_a = set(map(int,input().split()))
    set_b = set(map(int,input().split()))
    
    happiness = 0
    for i in array_n:
        if i in set_a:
            happiness += 1
        elif i in set_b:
            happiness -= 1
    
    print(happiness)
    
  • + 0 comments

    A oneliner:

    n, m = map(int, input().split())
    arr = list(map(int, input().split()))
    arr_a = set(map(int, input().split()))
    arr_b = set(map(int, input().split()))
    
    print(sum(1 if e in arr_a else -1 if e in arr_b else 0 for e in arr))
    
  • + 1 comment
    n,m=list(map(int,input().split()))
    arr=list(map(int,input().split()))
    A,B=set(map(int,input().split())),set(map(int,input().split()))
    a,b=[x for x in arr if x in A],[x for x in arr if x in B]
    print(len(a)-len(b))