Skip to content

Commit 129eb2c

Browse files
committed
Solve problems
1 parent 449ead5 commit 129eb2c

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
t= int(input())
2+
for i in range(t):
3+
n = int(input())
4+
ls = [int(j) for j in input().split()]
5+
ls.sort()
6+
ans = True
7+
ptr = 0
8+
while ptr != n - 1:
9+
if abs(ls[ptr]-ls[ptr + 1]) <= 1:
10+
ptr += 1
11+
else:
12+
ans = False
13+
break
14+
if ans:
15+
print("YES")
16+
else:
17+
print("NO")
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)