I'm having trouble comprehending the following question; if you could kindly assist me in understanding it, I'd be thankful. The query is:
Implement a dynamic programming algorithm for solving the following
problem. The input is an n × n matrix of integers. For the output:
compute the largest sum of adjacent entries in horizontal, vertical,
diagonal, and anti-diagonal directions. Return as output the sum
h + v + d + c (in suggestive notation) of those four auxiliary results.
The largest (or maximal) sum of an array consisting of only negative
integers are 0; that is, in that case, we select the empty subarray.
A (small) example input matrix with solution 45:
|-2 5 3 2|
|9 -6 5 3|
|1 -8 2 -3|
|-1 2 -5 2|
I read on this page that for the greatest amount of vertical entries, I should add up each item in a row and get the sum of them. For horizontal, add up the items in each column and seek for the maximum of those four.
Is that right? I mean, if someone could kindly point me in the correct way, I would be eternally thankful!!! Thanks