Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can brute force – try every (i,j) pair, and if the length is odd, go through and add the sum to the answer.
Solve with full IDE support and test cases