Assuming index final is the last one to pop, then we must have poped the left side and the right side. So coins when we pop final is

rangeValue[start][final-1] max coins from left side

rangeValue[final+1][end] max coins from right side

and current sequence is

start-1, final, end + 1

Starting from length == 1, so it cover each case.