```python
from typing import (
List,
)
class Solution:
"""
@param matrix: a 2D array
@return: return a list of integers
"""
def find_diagonal_order(self, matrix: List[List[int]]) -> List[int]:
# write your code here
list翻转存入结果
res = []
if not matrix:
return res
d = collections.defaultdict(list)
for i in range(len(matrix)):
for j in range(len(matrix[0])):
d[i + j + 1].append(matrix[i][j])
for k,v in d.items():
if k%2 != 0:
v.reverse()
res += v
return res
```