lastDp with the points from the first row of the matrix.i starting from the second row.
a. Initialize currentDp with zeros.
b. Initialize temp to 0.
c. Loop over columns j from left to right, updating temp and currentDp[j].
d. Reset temp to a large negative value.
e. Loop over columns j from right to left, updating temp and currentDp[j].
f. Update lastDp to be currentDp.lastDp.