for _ in range(int(input())): n=int(input()) a=[int(x) for x in input().split()] c=0 for i in a: if a.count(i)==1: c+=1 print(c%(10**9+7))
2 5 2 1 5 3 4 10 1 2 4 2 6 7 4 10 11 12
5 6
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!