i'd rewrite this whole thing as
```ruby
used_pairs.any? { |used_pair| used_pair.sort == pairing.sort }
```