title: Combination of n numbers into two unique groups
body: <p>I have to implement combination for a game where players are randomly selected into two group from n players in javascript.</p>
  
  <p>For example:</p>
  
  <p>If there are four players - A B C D</p>
  
  <p>AB vs CD - first round team
  AC vs BD - second round team
  AD vs BC - third round team</p>
  
  <p>If there are six players - A B C D E F</p>
  
  <p>ABC vs DEF
  ADE vs BCF </p>
  
  <p>Each time a player is playing with unique player in such a way that no two players can play the game with same players three times in a row. Is there any way to generate such kind of combination.</p>
  
  <p>Thank you for your answer.</p>