Google | Onsite | Given a matrix find all minimum values of sub-matrices size k
Anonymous User
6255

given an n x m matrix and a value k, find minimum values for all sub-matrixes of size k

example:
given this matrix:

	[
        [-1, 5, 4, 1, -3],
        [4,  3, 1, 1, 6],
        [2, -2, 5, 3, 1],
        [8,  5, 1, 9, -4],
        [12, 3, 5, 8, 1]
    ]

and a k of 3

result:

[
	[-2, -2, -3],
	[-2, -2, -4],
	[-2, -2, -4]
]
Comments (11)