[…] generally avoid resizing arrays inside a loop because it can be inefficient. However, sometimes you do not know in advance the final length of the result vector. In that case, …