I have a question similar to this one ( Find the largest rectangular block satisfying some condition without iterating explicitly). but in my case I have a multidimensional (up to 6 dimensions) binary array and I want to find the largest hyperrectangle (by volume, i.e. product of dimensions) that contains only 1's.
For example, in 3D, the data would look like:
data = Table[If[i - j - k <= -1, 1, 0]
, {i, 11}
, {j, 11}
, {k, 11}
];
https://i.stack.imgur.com/2tbfZ.jpg
Note that I'm looking for an algorithm, and it doesn't have to be written in mathematica.