Hello, I’ve tried this problem on my Python app, and according to what my inputs and outputs are, when submitting, it should be successful. Could anyone please help me? It would mean a lot. Thanks!
Here is my code:
T = int(input())
for i in range(T):
N = int(input())
L = [int(N) for N in input().split()]
T = []
total = 0
T.append(min(L))
L.remove(min(L))
T.append(min(L))
total = int(max(T)) - int(min(T))
print(total)