vector <vector <int>> code example
Example 1: how to make a 2d vector in c++
// Create a vector containing n
//vectors of size m, all u=initialized with 0
vector<vector<int> > vec( n , vector<int> (m, 0));
Example 2: how to create a vector from elements of an existing vector in cpp
// Initializing vector with values
vector<int> vect1{1, 2, 3, 4};
// Declaring another vector
vector<int> vect2;
// Copying vector by assign function
vect2.assign(vect1.begin(), vect1.end());