Question: Implement a function that takes a string and returns a new string that is a zig-zag rearrangement of it like the one in the examples
Implement a function that takes a string and returns a new string that is a zig-zag rearrangement of it like the one in the examples below.
• Parameters: text is a string (no validation needed)
• Examples:
zigzag('12345678') → '18273645'
zigzag('123456789') → '192837465'
zigzag('abcdefgh') → 'ahbgcfde'
zigzag('GeorgeMason') → 'GneoosragMe'
Step by Step Solution
3.48 Rating (164 Votes )
There are 3 Steps involved in it
To implement the zigzag function that rearranges a given string in a zigzag fashion lets break down ... View full answer
Get step-by-step solutions from verified subject matter experts
