Problems > Zigzag Diagonals > Editorial

Zigzag Diagonals — Solution & Editorial

Back to the Problem

Group cells by i+j; within a group generate bottom-to-top, and reverse every second group.

Complexity: O(NM)