1.

Consider a matrix in which all the elements are non-zero(at least one positive and at least one negative element). In this case, the sum of the elements of the maximum sum rectangle cannot be zero.(a) True(b) FalseThis question was addressed to me during an online interview.I'd like to ask this question from Maximum Sum Rectangle in a 2D Matrix in section Dynamic Programming of Data Structures & Algorithms II

Answer»

Right CHOICE is (a) True

The explanation is: If a matrix contains all non-zero ELEMENTS with at LEAST one positive and at least on negative element, then the sum of elements of the maximum sum RECTANGLE cannot be zero.



Discussion

No Comment Found

Related InterviewSolutions