picture, where each number is a pixel's brightness from 0 to 255.
A blur filter replaces every pixel with the average of the 3×3 square centered on it: the pixel itself plus up to eight neighbors, diagonal ones included. For pixels on an edge or in a corner, part of that square falls outside the picture; those cells are simply ignored, and the average is taken over the cells that exist (four in a corner, six along an edge).
Round each average down to an integer. Every pixel is computed from the original picture, not from values that were already blurred. Return the blurred picture, which has the same size.picture=[[9, 0], [0, 9]] → [[4, 4], [4, 4]]
For every pixel the window covers the whole 2×2 picture: (9 + 0 + 0 + 9) / 4 = 4.5, rounded down to 4.
picture=[[10, 20, 30], [40, 50, 60]] → [[30, 35, 40], [30, 35, 40]]
Corner (0, 0): 10, 20, 40, 50 average to 30. Pixel (0, 1): six pixels 10 to 60 sum to 210, average 35. Corner (1, 2): 20, 30, 50, 60 average to 40.
picture=[[7]] → [[7]]
A single pixel has no neighbors, so it stays as it is.
picture[i][j] ≤ 255picture=[[9, 0], [0, 9]]
[[4, 4], [4, 4]]
Run checks the first 3 tests in your browser. Submit checks all 81 tests on the server, hidden ones included.