Reorder a String from Both Ends

Given a string s, reorder its characters in this order: first character, last character, second character, second-to-last character, and so on until every character is used.

Output the reordered st...

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: