Problems > Rotate 90 Degrees > Editorial

Rotate 90 Degrees — Solution & Editorial

Back to the Problem

Rotated[j][i'] comes from g[N−1−i'][j]: the first column (bottom to top) becomes the first row.

Complexity: O(NM)