Programming Homework Help

CIS 340 Minnesota State University Mankato Intro to Java Exercise

 

You can see a “hollow square” of values at the top left, which are the nearest-neighbors of the element at [1, 1]. The sum of these values is 8. There are 16 possible hollow-squares in the 6×6 grid. Your task is to calculate the nearest-neighbor-sum of each, and return the biggest (which in this case would be 8 — some of the other neighbor-sums in this grid are 4, 3, 2, and 1. The array will always be 6×6.