Given a m * n matrix, find the max sum for path in the matrix. From row 'a' the next value can only be chosen from row 'a' + 1 and a penalty is assigned to the difference in column position. So, to jump from column 1 to column 3, the penalty would be 2 and should be subtracted from the sum calculation.
input =
[1,5,6,7
2,4,5,6
7,9,10,11]
one sample run from first item : 1 + 6 - 3 + 9 - 2 = 11
Find the maximun sum possible considering all combinations.