Efficient way of turning iterator into a matrix

no. But we can assume the lengths are all equal.