Input: arr[] = {1, 2, 3, 4, 5, 6}
Output: 3, 5, 6
Explanation:
The elements 3, 5, 6 are equal to sum of subarrays {1, 2},{2, 3} and {1, 2, 3} respectively.
Input: arr[] = {5, 6, 10, 1, 3, 4, 8, 16}
Output: 4, 8, 16
Explanation:
The elements 4, 8, 16 are equal to the sum of subarrays {1, 3}, {1, 3, 4}, {1, 3, 4, 8} respectively