-
Code const interwine = str => [str] .reduce((r,_,i,s) => i%2 ? [r,s[(s.length+i-1)/2]] : [r,s[i/2]], []) .join('')
Test Cases Test.assertEquals(interwine('13572468'), '12345678'); Test.assertEquals(interwine('acegbdfh'), 'abcdefgh');
Output:
-
- All
- {{group.name}} ({{group.count}})
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}