Zigzag ConversionMedium

string simulation math

Write s in a zigzag across numRows rows, then read row by row. Two approaches — simulate the bounce, or compute each row's indices with the period formula.

Press play to watch the algorithm run.
Metrics
Legend
How it works
0 / 0