vector<int> flatten(int a[100][200]); Write a function named \"flatten\" that ta
ID: 3552057 • Letter: V
Question
vector<int> flatten(int a[100][200]);Write a function named "flatten" that takes a 2-dimensional array of integers with 100 rows and 200 columns and returns a vector that contains all of the array vector<int> flatten(int a[100][200]);
Write a function named "flatten" that takes a 2-dimensional array of integers with 100 rows and 200 columns and returns a vector that contains all of the array Write a function named "flatten" that takes a 2-dimensional array of integers with 100 rows and 200 columns and returns a vector that contains all of the array
Explanation / Answer
vector<int> flatten(int a[100][200])
{
vector<int > vec;
for(int i=0; i<100; i++)
{
vec.insert(vec.end(), a[i], a[i]+200);
}
return vec;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.