problem So i know the solution is dp with 2 choices for index j in array for value i,closest left to j and closest right to j,but my query is if i don't choose optimally and instead choose m1= max value of (p+dp[i-1][p]) for p>j and m2=max value of (p-dp[i-1][p]) for p<j and then update dp[i][j]-max(m1,m2) will that also work?







