Вход: двумерный массив NxN - матрица - с положительными и отрицательными элементами.
Выход: подматрица любого размера, такая, что ее суммирование является максимальным среди всех возможных подматриц.
Требование: сложность алгоритма O (N ^ 3)
История: С помощью алгоритма, Ларри и модификации алгоритма Кадане мне удалось решить проблему частично, которая определяет только суммирование - ниже в Java.
Благодаря Ernesto, которому удалось решить остальную часть проблемы, которая определяет границы матрицы, то есть верхние левые, нижние правые углы - ниже в Ruby.