Zigzag Conversion — JavaScript medium interview problem
The string `"PAYPALISHIRING"` is written in a zigzag pattern on a given number of rows like this: ``` P A H N A P L S I I G Y I R ``` And then read line by line: `"PAHNAPLSIIGYIR"`. Write `convert(s, numRows)` that performs this conversion. Example: `convert("PAYPALISHIRING", 3)` → `"PAHNAPLSIIGYIR"`.
Tags: simulation, rows
Practice this Strings problem free in the JS Interview Playground with automated tests and unlockable solutions.