A contiguous growable array type with heap-allocated contents, written Vec<T>.
Vectors have O(1) indexing, amortized O(1) push (to the end) and O(1) pop (from the end).
You can explicitly create a Vec with Vec::new:
let v: Vec<i32> = Vec::new();
…or by using the vec! macro:
let v: Vec<i32> = vec![];
let v = vec![1, 2, 3, 4, 5];
let v = vec![0; 10]; // ten zeroes
to be able to edit vector elements you should make it mutable.
when accessing vector elements with index, the datatype of the index should be usize so consider that while iterating over vector elements