Free written solution

Diagonal Traverse II (LeetCode 1424): Solution and Explanation

Given a jagged 2D array where rows can have different lengths, list every element diagonal by diagonal: diagonals in increasing i + j, and each diagonal from bottom-left to top-right.

Read the intuition, approach, code and complexity →