A local maximum in a 2D array can be defined as a value such that all it\'s 4 neighbours are less than or equal to it, ie, for a[i][j]
to be a local maximum,
You are given an array of size 4 x 4. You will need to do the following task.
Fill the array with some random numbers using rand() function.
For each cell (i,j) your will need to find the cell with maximum number among all the possible neighbors the cell (i,j) has.
Then put that maximum number in the that cell (i,j)
Sample Input:
177 -90 12 7
1 34 43 67
11 11 122 45
6 90 98 93
Sample Output:
34 177 67 67
177 177 122 122
90 122 98 122
90 98 122 122