Naming a Company
You have an array of distinct company name ideas. A valid name is formed by picking two different ideas, swapping their first letters, and checking that both resulting strings are not already in the original set. Count how many distinct valid names (ordered pairs) can be formed.