I'm a student and I'm using c++. In the time I learn online I can't find detail about how vector<vector<>> works.
I want to ask how to use function like count(), find() for this type of vector?
Such as I have a vector<vector<int>> v= [[1,3],[2,3]] how can I using count to count how many 3 in all the vector or to find the first vector that have 3.
I new so maybe my question hard to understand, thank you for reading.
When I try this:
find(v.begin() , v.end(),{v[0][1]} or find(v.begin() , v.end(),v[0][1])
it gives an error.
This is a solution without loops, like you seem to be needing. Note the accumulate_threes_in_a_vector could also have been a lambda