Implement a function that takes a string and returns a new string that is a zig-zag rearrangement
Fantastic news! We've Found the answer you've been seeking!
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 below.
• Parameters: text is a string (no validation needed)
• Examples:
zigzag('12345678') → '18273645'
zigzag('123456789') → '192837465'
zigzag('abcdefgh') → 'ahbgcfde'
zigzag('GeorgeMason') → 'GneoosragMe'
Related Book For
Posted Date: