Solution and Explanation:
#include <iostream>
#include <vector>
using namespace std;
bool contains_all(vector<int> v1, vector<int> v2) {
for (int i = 0; i < v1.size(); ++i) {
bool found = false;
for (int j = 0; j < v2.size(); ++j) {
if (v1[i] == v2[j])
found = true;
}
if (!found)
return false;
}
return true;
}
int main() {
vector<int> v1 = {6, 3, 8, 3}, v2 = {3, 8, 8, 1, 6}, v3 = {3, 8, 8, 1};
cout << contains_all(v1, v2) << endl;
cout << contains_all(v1, v3) << endl;
return 0;
}