If we know tuples
is constructed from 3
grids, we can extract the lengths using:
lF = Map[l |-> Total @ Normalize[#, Min] & @ GroupBy[#, #[[l]] &, Length]] &
ngrids = 3;
lengths = lF[tuples] @ Range[ngrids]
{6, 6, 5}
Then, we can use a combination of ArrayReshape
and Extract
to get the three grids:
reshaped = ArrayReshape[tuples, Append[Length @ First @ tuples] @ lengths];
positions =
Map[m |-> {Splice @ RotateRight[Append[All] @ Table[1, # - 1], m], m}] @
Range[#] & @ ngrids;
Extract[reshaped, positions]
% == {grid1, grid2, grid3}
True