Reorder a String by Alternating Ends

Given a string s, reorder its characters by taking characters alternately from the beginning and the end of the original string:

  1. Take the first character.
  2. Take the last character.
  3. Take the...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: