I Don’t know how allocation works on this, but you might try using
TMap<int32,SomeTypeYouUse>
TMap it a map that uses custom index, index in TMap need to be stored to so you can use any index and you wont have empty elements
Problem with TMap is that it not supported by reflection system so you need to memory manage it