title: How to find the common group to which given candidates belong to
body: <p>Consider the following table below:</p>
  
  <pre><code>User ID       Group
  1              G1, G2
  2              G2, G4
  3              G1, G3
  4              G2, G3
  5              G1
  </code></pre>
  
  <p>What is the quickest possible way to identify the common group for given users, say 1, 3 and 5? I am trying to implement this in C++.</p>