The Captain's Room

Sort by

recency

|

1565 Discussions

|

  • + 0 comments

    Solution with only implement set concept

    k = int(input())
    rooms = list(map(int, input().split()))
    
    unique_room = sum(set(rooms))
    total_rooms = sum(rooms)
    
    print((k*unique_room-total_rooms)//(k-1))
    
  • + 0 comments

    from collections import Counter k=int(input()) ABC = Counter(input().split()) for item,value in ABC.items(): if value==1: print(item)

  • + 0 comments

    member = int(input()) lst = list(map(int, input().split())) dct = dict()

    for i in lst: if i in dct: dct[i] += 1 else: dct[i] = 1

    for key, value in dct.items(): if value == 1: print(key) break;

  • + 0 comments

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

    k = int(input()) l = list(map(int,input().split())) l.sort()

    for i in range(0,len(l)-1,k): if l[i] != l[i+4]: break

    else:
        i = len(l) - 1    
    

    print(l[i])

  • + 0 comments
    from collections import Counter
    k = int(input())
    CountedList = Counter(list(map(int,input().split())))
    for room,freq in CountedList.items():
        if freq == 1:
            print(room)