Wrong answer for test case 3 and test case 5

I am getting wrong answer for 2 test cases, please help

Please send your code link.
Hint -:
Forward * = Max score, if we move forward from K to i, for all K <= i <= N.
Backward ∗ = Max score if we move backward from i to 1, for all K <= i <= N.

Ans = Max (Forward* + Backward*) for all K <= i <= N.

Make sure to include the case in which you don’t move forward at all.