Given a set of numbers k, find all subsets of k such that each has an even number of integers, and then return the sum
of all these subsets.
A subset is a contiguous subsequenceof k
Input: k = [1,4,2,5]
Output: 30
Explanation: The possible subarrays of k and their sums are:
[1,4] = 5
[4,2] = 6
[2,5] = 7
[1,4,2,5] = 12
The sum of all subarrays = 5 + 6 + 7 + 12 = 30
- 1 <= k.length <= 100
- 1 <= k[i] <= 1000