Write a program for given m*n matrix find its anti diagonal matrix
M, N = map(int, input().split())
matrix = [list(map(int, input().split())) for i in range(m)]
maximum_sum = M+ N- 2
for s in range(maximum_sum+1):
for i in range(s+1):
if i < M and s - i < N:
print(matrix[i][s- i], end=" ")
print()
Comments
Leave a comment