[LintCode] Submatrix Sum 子矩阵之和

Posted Grandyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[LintCode] Submatrix Sum 子矩阵之和相关的知识,希望对你有一定的参考价值。

 

Given an integer matrix, find a submatrix where the sum of numbers is zero. Your code should return the coordinate of the left-up and right-down number.

Example

Given matrix

[
  [1 ,5 ,7],
  [3 ,7 ,-8],
  [4 ,-8 ,9],
]

return [(1,1), (2,2)]

Challenge 

O(n3) time.

 

以上是关于[LintCode] Submatrix Sum 子矩阵之和的主要内容,如果未能解决你的问题,请参考以下文章

Lintcode: Interval Sum II

lintcode-medium-3 Sum

lintcode-medium-3 Sum Closest

lintcode-medium-4 Sum

lintcode-medium-Subarray Sum Closest

lintcode-easy-Minimum Path Sum