https://codeforces.com/contest/1512/problem/A
시간 2초, 메모리 256MB
input :
output :
조건 :
쉽게 확인할 방법이 뭐가 있을까 했는데 정렬을 한 후에 0, -1, -2의 값 3개를 이용해서 체크를 해도 될거 같고 근데 조건문이 많은거 같아서 카운팅 한 후에 1개만 나타난 것을 찾아서 출력하도록 했다.
import sys
t = int(sys.stdin.readline())
for _ in range(t):
n = int(sys.stdin.readline())
data = list(map(int, sys.stdin.readline().split()))
temp = dict()
for i in data:
if i not in temp:
temp[i] = 1
else:
temp[i] += 1
for key in temp.keys():
if temp[key] == 1:
print(data.index(key) + 1)
continue