Should n't my recursive relation look somethig like this?

forward phase:

dpf[i] = max ( arr[i+1]+func(i+2,j) , arr[i+2]+func(i+3,j) )

backward phase:

dpb[i]=max( arr[i-1]+func(i-2,j) ,arr[i-2]+func(i-3,j) )

at the end we can return dpf[k]+dpb[k]

dpb case i traverse in reverse direction