문제 링크
문제 풀이
내 코드
import sys
T = int(sys.stdin.readline())
while T>0:
T -= 1
N = int(sys.stdin.readline())
myList = list(map(int, sys.stdin.readline().split()))
ans = -999999
myList.sort()
idx = 0
for i in range(0, (int)(len(myList)/2), 1):
if ans < (myList[(2 * i + 1)] - myList[idx]):
ans = (myList[(2 * i + 1)] - myList[idx])
idx = 2 * i + 1
idx = 0
for i in range(0, (int)(len(myList)/2), 1):
if (2 * i + 2)>=len(myList):
break
if ans < (myList[(2 * i + 2)] - myList[idx]):
ans = (myList[(2 * i + 2)] - myList[idx])
idx = 2 * i + 2
print(ans)
```