Instead of hardcoding values , can you change the code to to take input of vector<vector<int>> dynamically

hi @kishoretaru here’s the code for creating a m*n 2D vector dynamically and taking input for it. https://ide.codingblocks.com/s/302982

vector<vector> v(n, vector(m, 0));
Can you explain this?

@kishoretaru
first argument is the size of vector, second argument is the value you want to initialise it with.
so i want a vector with n rows, and I want each row to be another vector of size m and value 0. I hope it is clear now.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.