You are viewing a single comment's thread. Return to all comments →
Because you need to work with previous values.
That's why the first values are all '0' on both the line and column, and the value sums start from indeces 1 and 1.
arr[i + 1][j + 1]
That's why you need to allocate an extra cell for both line and column.
Seems like cookies are disabled on this browser, please enable them to open this website
Common Child
You are viewing a single comment's thread. Return to all comments →
Because you need to work with previous values.
That's why the first values are all '0' on both the line and column, and the value sums start from indeces 1 and 1.
That's why you need to allocate an extra cell for both line and column.