Skip to content · ⁨본문 바로가기⁩

Transpose a grid · ⁨행렬 전치⁩

English

Transpose a grid

Swap the rows and columns of a grid, as if you reflected a table across its diagonal.

grid[r][c] is the item in row r and column c. The new grid has one row for each column of the old one, so loop over the column numbers first, and inside that loop collect row[col] from every row.

한국어

격자 전치(Transposition)

테이블을 대각선을 따라 반사한 것처럼 격자의 행과 열을 교차시킵니다.

grid[r][c]은 행 r과 열 c에 있는 항목입니다. 새 격자는 이전 격자의 각 열에 대해 하나의 행을 가지므로, 먼저 열 번호를 순회하고 그 내부 루프에서 모든 행에서 row[col]을 수집합니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP