If you want a two-dimensional array (array of arrays), you can always represent that as a one-dimensional/flattened array.
You’ll just have to do a little math for finding the correct index.
For high performance scenarios, I’ve always found this method to be more efficient when iterating sequentially over all elements.