Skip to content

Latest commit

 

History

History
8 lines (5 loc) · 339 Bytes

File metadata and controls

8 lines (5 loc) · 339 Bytes

Given a string, make a new one following a zig-zag pattern. This means it will take the first letter, the last, the second, second to last, until there aren’t any letters left in the original string.

For example:

  • zig_zag("apple")'aeplp'
  • zig_zag("string")'sgtnri'
  • zig_zag("codingbat")'ctoadbign'