View difference between Paste ID: 7FdJuvvR and U8Rf4ViJ
SHOW: | | - or go back to the newest paste.
1
for (int A = 1; A < N - 2; A++) {
2
	int ProfitA = Sum(array[0...A-1]);
3
	int ProfitB = array[A];
4-
	int ProfitC = Sum(array[A...N])
4+
	int ProfitC = Sum(array[A+1...N-])
5
	for (int B = 1; B < N - 1; B++) {
6
		//here the values are "current
7
8
		//and here they are being prepared for the next iteration
9
		ProfitB = ProfitB + array[A+B-1];
10
		ProfitC = ProfitC + array[A+B]);
11
	}
12
}