algorithms.tutorialhorizon.com
Print all middle elements of the given matrix/2D array | Algorithms
Objective: Given a two-dimensional array, write a program to print all middle elements of the array. Or In other words, print all the elements from the array except boundary elements. Example: int [][] grid = new int[][] { {1, 2, 3, 4, 8}, {5, 6, 7, 8, 9}, {9, 8, 7, 6, 7}, {5, 4, 3, 2, 2}, {1, 2, 3, 4, 8} Output: 6 7 8 8 7 6 4 3 2