Array Reverse Sums

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
Test Cases
Test Case 1
Argument 1 123,456,789
Argument 2 0,2
Expected Output 1308
Test Case 2
Argument 1 566,655,334,123
Argument 2 1,2
Expected Output 989
Test Case 3
Argument 1 1234,5678,8765,4321
Argument 2 2,3
Expected Output 6912
Test Case 4
Argument 1 12,34,56,78
Argument 2 0,1,2,3
Expected Output 216
Your Submission
You are not logged in. To submit a solution, click the Login button at the top right.
Submissions

Login/Register

At the moment only Discord login is supported.

Login with Discord