rows rows. The characters go in along diagonals: the first diagonal starts in the top-left cell and runs down and to the right to the edge of the table, the next one starts in the top cell of the second column, and so on. Free cells on those diagonals get spaces, while the cells below and to the left of the main diagonal, which the text never reaches, hold arbitrary decoy characters.
The table is then written out as a single string grid_text, row by row, left to right, so each table row is len(grid_text) / rows characters long.
Given grid_text and rows, read the hidden text: walk the diagonals starting at each cell of the top row, in order from left to right, and drop the trailing spaces from the result.grid_text='hlo el', rows=2 → 'hello'
The table is 2×3 with rows hlo and el. The diagonal from column 0 gives h, e; from column 1, l, l; from column 2, o. Together: hello.
grid_text='mtton e o ean', rows=3 → 'meet at noon'
Three rows of 5 characters. The table rows are mtton, e o, ean. The diagonals read mee, t a, t n, oo, n, which together give meet at noon.
grid_text='g o ', rows=3 → 'go'
A 3×2 table: g , o, . The diagonal from column 0 gives g, o and a space, the one from column 1 a space. Trailing spaces are dropped.
grid_text contains only lowercase English letters and spaceslen(grid_text) is divisible by rowsgrid_text='hlo el', rows=2
'hello'
Run checks the first 3 tests in your browser. Submit checks all 39 tests on the server, hidden ones included.