The Captain's Room

  • + 0 comments

    Dictionary Solution

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    n = int(input())
    
    rooms = list(map(int,input().split()))
    
    # print(n)
    counts = {}
    for _ in rooms:
        counts[_] = counts.get(_,0)+1
    print(min(counts,key=counts.get))