Given a two-dimensional array of integers, a pair of row/column indexes r and c, and a string "N", "E", "S" or "W", return the neighbor in that direction, or 0 if it doesn't exist.