Math, asked by TbiaSamishta, 1 year ago

given a matrix m of size nxm and an integer k find the maximum element in the k manhattan distance neighbourhood for all elements in nxm matrix.

Answers

Answered by aqibkincsem
0

Matrix m of size nxm and an integer k find the maximum element in the k manhattan distance neighbourhood for all elements in nxm matrix using O [mn ] space complexity with the O[ (m-k)*(n-k) + mn] time complexity.


Create the sum matrix of dimension (m x n) with matrix sum of elements in input matrix of rows.

Answered by Aɾꜱɦ
22

Answer:

Given a matrix M of size nxm and an integer K, find the maximum element in the K manhattan distance neighbourhood for all elements in nxm matrix. # In other words, for every element M[i][j] find the maximum element M[p][q] such that abs(i-p)+abs(j-q) <= K.

#answerwithquality #bal

Similar questions