def test_2(): sol = Solution() m = n = 50 for _ in xrange(5): matrix = np.random.randint(-100, 100, (m, n)).tolist() k = np.random.randint(-400, 400) assert sol.maxSumSubmatrix(matrix, k) == maxSumSubmatrix(matrix, k)
def test_4(): sol = Solution() matrix = [[5, -4, -3, 4], [-3, -4, 4, 5], [5, 1, 5, -4]] assert maxSumSubmatrix(matrix, 3) == 2 assert sol.maxSumSubmatrix(matrix, 3) == 2
def test_3(): sol = Solution() matrix = [[2, 2, -1]] assert maxSumSubmatrix(matrix, 0) == -1 assert sol.maxSumSubmatrix(matrix, 0) == -1
def test_1(): sol = Solution() matrix = [[1, 0, 1], [0, -2, 3]] assert sol.maxSumSubmatrix(matrix, 2) == 2
def test_0(): sol = Solution() assert sol.maxSumSubmatrix([], 10) == 0 assert sol.maxSumSubmatrix([[]], 10) == 0