Can you give more examples

question is not clear , need more examples and output to understand , and alsp pls explain this question using examples

Hey @Himanshu-Jhawar-2273952536067590
3
1 2 1
correct output : 7
1 , 2 ,1
1 2 , 2 1

what will be answer for
5
1 2 3 2 1

also tell all subarays

1
1 2
1 2 3
2
2 3
3
3 2
3 2 1
2
2 1
1
output 19