Q:

binning an array to create sum domains array

In Mathematica - how do I bin an array to create a new array which consist from sum domains of the old array with a given size ???
Example:

thanks.

A:

This works for the example but a generalised version would need more work.
array =
  {{1, 1, 1, 2},
   {1, 1, 3, 4},
   {2, 2, 2, 3},
   {2, 2, 2, 3}};

Map[Total,
 Map[Flatten,
  Map[Transpose,
   Map[Partition[#, 2] &, Partition[array, 2], 2],
   2], {2}], {2}]

% // MatrixForm

4 10
8 10

