How do I select only the first pair of numbers in which a number occurs from a list of pairs of numbers?
For example, I have
{{20, 11}, {17, 20}, {26, 5}, {14, 9}, {18, 13}, {19, 11}}
I would like to get
{{20, 11}, {26, 5}, {14, 9}, {18, 13}}
and If I have
{{20, 11}, {17, 20}, {26, 13}, {14, 26}, {11, 20}, {18, 13}, {19, 11}}
I would want
{{20, 11}, {26, 13}}
That is: the resulting list must have the properties that
- it contains only pairs from the original list, and that
- it has been pruned (just*) to the extent that each number occurs in only one pair.
*Ideally the result should retains the most pairs (realizing that my examples above may not accomplish this).