The Codetikki stonemasons carve messages in zigzag patterns across temple walls. Characters are placed diagonally from top-left to bottom-right until reaching the kth row, then back up, repeating. Given a string and a number of lines k, print the string in zigzag form across k rows.
Example 1:
Example 2:
Constraints:
1 <= len(s) <= 1000 1 <= k <= 1000 s consists of lowercase English letters
Tags:
