what is wrong with this code
for _ in range(int(input())):
n=int(input())
for i in range(n):
l=
for j in range(n):
if i>=j:
l.append(((max(i,j)+1)**2)-j)
else:
l.append(((max(i,j)+1)**2)-j-abs(i-j))
print(*l)
the outputs are
Sample Input
1
5
Your Output
1 2 5 10 17
4 3 6 11 18
9 8 7 12 19
16 15 14 13 20
25 24 23 22 21 it works well for all the possible values. but not accepting
My code
for _ in range(int(input())):
n=int(input())
for i in range(n):
l=[]
for j in range(n):
if i>=j:
l.append(((max(i,j)+1)**2)-j)
else:
l.append(((max(i,j)+1)**2)-j-abs(i-j))
print(*l)