Create multidimensional array spanned by unknown number of arrays

Check for a possible solution in this post.