how to place exactly 2 elements in every 2x2 sub array in nxn int array such that the sum is maximum? for example, if you have 3x3 array [5 1 4] [1 8 2 ] [1 7 1] you will place in the following way (every 2x2 sub array we place exactly 2 elements denoted as p) to maximize the sum [p 1 p] [1 p 2] [1 p 1] such that sum = 5+4+8+7=24 if you place like [p 1 p] [p 8 p] [1 p 1] will give sum = 5+4+1+2+7=19 which is not maximum.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)