Fold an array of integers by summing symmetric pairs
Filed under Thoughtworks
The question
Given an array of even length containing integers, fold the array such that the new list contains the sum of the first and last elements, second and second-to-last elements, and so forth.
No write-up yet. Related questions below have one.
Related Thoughtworks questions
Collected from public candidate posts and coding forums. Updated Nov 2026.