Given 2 x comma separated array of elements, the first input being the array of numbers, the second being the positions to reverse in the array and sum.
Provide the sum of the reversed numbers only.
Example:
Input:
- 123,456,789
- 0,2
Array: [123,456,789]
Selected Elements: [Array[0],Array[2]]
Selected Elements: [123,789]
Reversed Elements: [321,987]
Sum: 321 + 987
Output: 1308
Argument 1 123,456,789Argument 2 0,2Expected Output 1308
Argument 1 566,655,334,123Argument 2 1,2Expected Output 989
Argument 1 1234,5678,8765,4321Argument 2 2,3Expected Output 6912
Argument 1 12,34,56,78Argument 2 0,1,2,3Expected Output 216