My issue
my code is correct by when i submit it is showing wrong please debug the test cases
My code
# cook your dish here
for i in range(int(input())):
n = int(input())
mylist = []
first = 1
last = n
for i in range(n//2):
mylist.append(first)
mylist.append(last)
first+=1
last-=1
if n%2 !=0:
print(first,*mylist)
else:
temp = mylist[-1]
mylist[-1] = mylist[-2]
mylist[-2] = temp
print(*mylist)
Problem Link: Different Medians Practice Coding Problem