please help me in finding the error in the logic in my mind i am unable to find
Where my solution is getting wrong?
any TA please help on this
@Shobhit_kumar
Consider this testcase
6 1
5 4 3 2 1 10
Ans should be “18” (5+3+10 =18) but your code is giving “10”