#vector of vectors?
11 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
On mobile so I'll check it out better in a bit. A vector of a vector is basically a 2 dimensional array.
You push vectors of ints in the vectors of vectors. Last time I used it was for a grid, it made it easy to access elements with x and y coords. For example: grid[x][y]
It uses constructor 3 twice: https://en.cppreference.com/w/cpp/container/vector/vector
The inner vector makes a vector with target + 1 ints of value 0 and the outer vector puts n of those into dp.
So you sort of end with an n*target+1 matrix filled with 0s.
so basically it uses the first n to declare for the outer vector the amount of vectors of size target+1 it has ( so first constructor for the outer declaration and the second is the size of the inner vector declared)
if anybody can confirm this im marking it as solved
i am familiar with bidimensional normal arrays, i am unfamiliar with stl vector's syntax
Yeah
!solved