2d vector pusph back

Solutions on MaxInterview for 2d vector pusph back by the best coders in the world

showing results for - "2d vector pusph back"
Mía
17 Jan 2020
1std::vector<std::vector<int>> normal;
2for(int i=0; i<10; i++)
3{
4  	//push a vector each time you loop a row
5    normal.push_back(std::vector<int>());
6    for(int j=0; j<20; j++)
7    {
8      	//push an item each time you loop a column
9        normal[i].push_back(j);    
10    }
11}