The Captain's Room

Sort by

recency

|

1554 Discussions

|

  • + 0 comments

    I couldn't help myself.

    from collections import Counter
    
    input()
    
    print(Counter(list(map(int,input().split()))).most_common()[:-2:-1][0][0])
    
  • + 0 comments

    size=int(input()) Room_Number=list(map(int,input().split()))

    captain = (sum(set(Room_Number)) * size - sum(Room_Number)) // (size - 1) print(captain)

    ​
    
  • + 0 comments
    if __name__ == '__main__':
        size =int(input())
        room_num = list(map(int,input().split()))
        
        set_rn = set(room_num)
        
        for i in set_rn:
            room_num.remove(i)
        
        set_rn.symmetric_difference_update(room_num)
        
        print(int("".join(str(i) for i in set_rn)))
            
    
  • + 0 comments
    K = int(input())
    arr= list(input().split())
    s =set(arr)
    
    for ch in s:
        arr.remove(ch)
    temp = s.difference(set(arr))
    print("".join(temp))
    
  • + 0 comments

    solve it by using dict add the values and just call the value whose count is one thats the captain room

    k = int(input()) rooms = list(map(int,input().split()))

    dict1 = {}

    for i in rooms: dict1[i]= dict1.get(i,0)+ 1

    for keys,values in dict1.items(): if values == 1: print(keys)