title: Iterate every combination of two elements in HashSet
body: <p>How could I iterate through each combination of two elements in a HashSet once?</p>
  
  <pre><code>foreach (var elt1 in hashSet) {
    foreach (var elt2 in hashSet) {
      ...
    }
  }
  </code></pre>
  
  <p>This would iterate the combinations of two but would iterate each combination TWICE. I'd like to do it once.</p>
  
  <p>I think it's easy to do in Python. Is there any way to do it in C#?</p>
  
  <p>Sample:</p>
  
  <p>input hashSet: { 1, 2, 3, 4 }</p>
  
  <p>iterate through: (1,2), (1,3), (1,4), (2,3), (2,4), (3,4)</p>