Max sum of sub-matrix no larger than K | LeetCode Discuss
Given a 2D matrix A and an integer K, find the max sum of A's sub-matrix. The max sum should be no larger than K.
Example:
Given A = [ [-1, 0, 1], [0, -2, 3] ] K = 2
The answer is 2. Because the sum of sub-matrix[[0, 1], [-2, 3]]
is 2 and 2 is the max number no larger than K(K = 2).
Read full article from Max sum of sub-matrix no larger than K | LeetCode Discuss
No comments:
Post a Comment