public static long kadane(long[] comp) {
		long sum = 0, max = Long.MIN_VALUE;
		startRow = endRow = 0;
		for (int i = 0; i < m.length; i++) {
			sum += comp[i];
			if (sum < 0) {
				sum = 0;
				startRow = i + 1;
			} else if (max < sum) {
				max = sum;
				endRow = i;
			}
			max = Math.max(max, comp[i]);
		}
		return max;
	}