How to compare and remove elements that does not have same value between 3 vectors?
<p>I need to remove every elements that doesn't have same value between 3 vectors or more.
For example,</p>

<pre><code>vector&lt;int&gt; Vector1, Vector2, Vector3;
for(int i = 2; i &lt; 7; i++) Vector1.push_back(i); // Vector1 = {2, 3, 4, (5), (6)}
for(int i = 3; i &lt; 8; i++) Vector2.push_back(i); // Vector2 = {3, 4, (5), (6), 7}
for(int i = 5; i &lt; 10; i++) Vector3.push_back(i); // Vector3 = {(5), (6), 7, 8, 9}
</code></pre>

<p>We know that all of the vectors has 2 elements with same value: 5 and 6. Now how do I get these values and store them to a new vector?</p>

<p>Any kind of help would be appreciated :)</p>
