Flatten array without loosing "structure"

Another solution is given here

wcomABdivmat.nb (367 KB)