you give n x n integer matrix gridGenerate integer matrix maxlocal size n 2 x n 2 thatmaxLocalij equal large value 3 x 3 matrix grid center row 1 column j 1in word want find large value contiguous 3 x 3 matrix gridReturn generate matrix Example 1input grid 9981562682646222output 9986explanation the diagram show original matrix generate matrixnotice value generate matrix correspond large value contiguous 3 x 3 matrix gridExample 2input grid 1111111111112111111111111output 222222222explanation notice 2 contain contiguous 3 x 3 matrix grid Constraintsn gridlength gridilength3 n 1001 gridij 100