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