Given a string s and an integer numRows, rearrange the characters of s by writing them in a zigzag pattern across numRows rows, then reading the result row by row from top to bottom.
For example, writing "COMPUTER" in a zigzag pattern across 3 row produces:
C UO P T RM E
This will be read as "CUOPTRME".
Constraints:
s.length
s consists of English letters (lower-case and upper-case), ',' and '.'.
numRows
Given a string s and an integer numRows, rearrange the characters of s by writing them in a zigzag pattern across numRows rows, then reading the result row by row from top to bottom.
For example, writing "COMPUTER" in a zigzag pattern across 3 row produces:
C UO P T RM E
This will be read as "CUOPTRME".
Constraints:
s.length
s consists of English letters (lower-case and upper-case), ',' and '.'.
numRows