How to "flatten" or "index" 3D-array in 1D array? How to "flatten" or "index" 3D-array in 1D array? arrays arrays