Given an `m x n` integer matrix `img`, for each cell compute the average of it and its 8-direction neighbors (floor of mean). Return the smoothed image. Use neighbor checking and boundary conditions.
2D list of ints.
2D list of ints.
Example 1:
Input:
img = [[1,1,1],[1,0,1],[1,1,1]]
Output:
[[0,0,0],[0,0,0],[0,0,0]]
Explanation:
Each center is (1+1+1+1+0+1+1+1+1)/9 = 8/9=0; edges avg = floor of neighbor sum.