Created
May 1, 2021 00:09
-
-
Save iconjack/44afd31bc045f251114ba987a0cc18d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import combinations | |
from string import ascii_uppercase | |
states = ["Alabama", "Alaska", "Arizona", "Arkansas", "California", | |
"Colorado", "Connecticut", "Delaware", "Florida", "Georgia", | |
"Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", | |
"Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", | |
"Massachusetts", "Michigan", "Minnesota", "Mississippi", "Missouri", | |
"Montana", "Nebraska", "Nevada", "New Hampshire", "New Jersey", | |
"New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", | |
"Oklahoma", "Oregon", "Pennsylvania", "Rhode Island", "South Carolina", | |
"South Dakota", "Tennessee", "Texas", "Utah", "Vermont", | |
"Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming" ] | |
rows = [] | |
for x,y in combinations(ascii_uppercase, 2): | |
count = 0 | |
for state in states: | |
state = state.upper() | |
if x not in state and y not in state: | |
count += 1 | |
rows.append((count, x, y)) | |
for row in sorted(rows): | |
print("%2d %s %s" % row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment