Can you compute the number of indices up front and create a typed array?