text is written as a snake across rows lines: the first letter goes on the top line, the next ones go down one line at a time to the bottom line, then diagonally back up to the top, down again, and so on. For example, SNOWFALL on three lines looks like this:
S F
N W A L
O L
Then the lines are read from top to bottom, each from left to right, and joined together. Return the resulting string. With rows = 1 the text does not change.text="SNOWFALL", rows=3 → 'SFNWALOL'
The three-row snake is S . . . F . . . / . N . W . A . L / . . O . . . L .. Reading row by row gives SF + NWAL + OL.
text="abcdef", rows=2 → 'acebdf'
With two rows the letters simply alternate: even positions on top, odd ones below.
text="hi", rows=5 → 'hi'
There are more rows than letters, so the text stays a single column and comes out unchanged.
, and .text="SNOWFALL", rows=3
'SFNWALOL'
Run checks the first 3 tests in your browser. Submit checks all 89 tests on the server, hidden ones included.