Anti-Diagonal Zig-Zag Matrix Order

Asked at Cisco · Coding Questions · Difficulty: Medium · Last asked Aug 25, 2025

Given a rectangular matrix of integers, return all of its elements as one list, read along the anti-diagonals in a zig-zag. The walk starts at the top-left cell, moves through the matrix one anti-diagonal at a time, and switches reading direction on every new anti-diagonal.

Loading the problem…