Hackerrank Python | Challenge #64 | The Caption's Room

preview_player
Показать описание


follow me on

Рекомендации по теме
Комментарии
Автор

Le me who spends hours to figure out and end with this code:
k = int(input())
room_no = list(map(int, input().split()))
distinct_room = list(set(room_no))
count = 0
for i in distinct_room:
for j in room_no:
if i == j:
count += 1
if count == 1:
cap_room = i
count = 0
print('Captain Room:', cap_room)

its actually works good but don't know why it only correct 2 cases

Shisuiii