6. ZigZag Conversion
Approach 1: Iterate character by character
Iterate over the characters one by one, while maintaining a counter for current row number. Keep incrementing the counter one by one and when you reach numRows
start subtracting 1 each time, and append the character to the calculated index and return the join of all these rows as a string
Time Complexity: O(n)
Space Complexity: O(n)
Last updated