[#498] docs(FindDiagonalOrder) : add solution note

This commit is contained in:
2025-08-25 11:04:08 +08:00
parent 541227b060
commit 385787dbdc

View File

@@ -0,0 +1,7 @@
1. 觀察矩陣對角線模式
1. (0,0) -> 1 -> i+j = 0
2. (1, 0), (0, 1) -> 2 -> i+j = 1
3. (2, 0), (1, 1), (0, 2) -> 3 -> i+j = 2
2. how to deal with diagonal sorting?
1. while (i+j) % 2 == 1
2. while (i+j) % 2 == 0 reversed