Given a two-dimensional array of integers, return the sum of all elements along the north and south border. If there is only one row, it will be treated as both the North and South border.