Rules
The program should receive a string/array of words as input. For each word in the string/array, it will reconstruct the word by taking characters in alternating fashion from the front and back of the word.
12345 678 9 -> 15243 687 9.
It will then rearrange the words in an alternating fashion between the earliest and the latest occurring word in the string.
15243 687 9 -> 15243 9 687
Finally, it will reconstruct the string by placing the spaces, tabs and newlines at the indexes where they were initially located before outputting the result.
12345 678 9-> 15243 687 9 -> 15243 9 687 -> 15243 968 7
Output should be the same datatype as the input.
Standard Loopholes are forbidden
Examples
Input:
The quick brown fox jumps over the lazy dog.
Output:
Teh d.ogq kucil yaz bnrwo tehf xoo rvej supmInput:
The quick brown fox jumps
over the lazy dog.
Output:
Teh d.ogq kucil yaz bnrwo
tehf xoo rvej supmInput:
Aflack
Output:
Akfcla
This is code-golf so shortest code wins