Programming problem in python (The Captain's Room)

This is the problem in hackerrank. I sloved it using couple way.But,first time it passed test case 0 but not fully submitted cause other test case not passed.I read this problem many time but i can’t figure out what is the different of my first solution and ultimate solution.
The way i solve it first time,
Number 01:

n = int(input())
l = list(map(int,input().split()))
for x in l:
    if l.count(x) == 1:

and ultimately this problem solved this,
Number 02:

k,arr = int(input()),list(map(int, input().split()))
myset = set(arr)

I solved it.But i still don’t understand that,why number 01 is fail?
I thought, it’s the easy way to fix this

We need the problem description to be able to discuss the problem.

i update my post~