Simple python Code ;3


#1
class Solution:
# @param A : list of list of integers
# @return a list of list of integers
def diagonal(self, A):
    n = len(A)
    if n: m = len(A[0])
    else: return []
    ans = [[] for _ in range(m+n-1)]
    for i in range(n):
        for j in range(m):
            ans[i+j].append(A[i][j])
    return ans