Given a rectangular, two-dimensional array of integers and a string "NW", "NE", "SW, or "SE", return the sum of the four elements in the corner of the given compass direction.
For instance, if "NW" is given, then the four elements in the
Northwest corner are at [0][0]
, [0][1]
,
[1][0]
, and [1][1]
.
You may assume that the two-dimensional array is at least 2x2.