Skip to content

Commit a10cb52

Browse files
Added twice-counter
1 parent d0fb520 commit a10cb52

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

amazon/twice_counter.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#code
2+
from collections import Counter
3+
n = int(input())
4+
5+
for i in range(n):
6+
_ = int(input())
7+
tc = list(map(str, input().split(' ')))
8+
counter = Counter()
9+
for i in range(len(tc)):
10+
counter[tc[i]] += 1
11+
cn = 0
12+
for k,v in counter.items():
13+
if v == 2:
14+
cn += 1
15+
print(cn)

0 commit comments

Comments
 (0)