Largest Local Values in a Matrix
You're given an n x n integer matrix, grid. Your task is to generate an integer matrix, maxLocal, of size (n - 2) x (n - 2), such that:
maxLocal[i][j] equals the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1. In other words, you need to find the largest value in every contiguous 3 x 3 matrix in grid.
Your function should print the generated matrix, maxLocal (where all elements are space separated)
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)