ZigZag Conversion
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 column by column: "PAHNAPLSIIGYIR"
Write a function convert(s: str, n: int) -> str that will take in two parameters:
- a string s containing uppercase and lowercase English letters, and
- an integer n, which represents the number of rows for the zigzag pattern.
The function should return the zigzag pattern of s as a string.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)