title: Matching users based on their input and choosing from one of them
body: <p>I am trying to implement a situation, where users have the options to to pick the numbers 1-3 and then they again pick another set of numbers 1 to 3. </p>
  
  <p>So the possible combinations of results would go:</p>
  
  <ul>
  <li>1 &amp; 1</li>
  <li>1 &amp; 2</li>
  <li>1 &amp; 3</li>
  <li>2 &amp; 1</li>
  <li>2 &amp; 2</li>
  <li>2 &amp; 3</li>
  <li>3 &amp; 1</li>
  <li>3 &amp; 2</li>
  <li>3 &amp; 3</li>
  </ul>
  
  <p>I want to match the users that picked the same combinations (essentially putting them in the same category) and then later randomly select one of them from said category. </p>
  
  <p>My approach to this was get the users input(which I've already implemented) and then put it into a database. </p>
  
  <p>Then follow on by randomly selecting a user in that category. </p>
  
  <p>After a user is selected then all users are taken out of the category and can repick two new options. </p>
  
  <p>I am not sure if putting them in the database would be the best approach, how else could I do this?</p>