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
Best abbreviation(s): | |
--------------------- | |
FM : FMNCAKSCOHIALARIDCTNMPWVINVASDE | |
LONGEST FOR ALL ABBREVIATIONS | |
----------------------------- | |
Longest for AK : AKSCALARIASDCOHINCTNMPWVIDE | |
Longest for AL : ALAKSCARIASDCOHINCTNMPWVIDE | |
Longest for AR : ARIAKSCALASDCOHINCTNMPWVIDE | |
Longest for AS : ASCAKSDCOHIALARINCTNMPWVIDE |
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
#!/usr/bin/python | |
from collections import defaultdict | |
_ABBRS = [ | |
'AK', 'AL', 'AR', 'AS', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'FM', | |
'GA', 'GU', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MD', 'MA', | |
'ME', 'MH', 'MI', 'MN', 'MO', 'MP', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', | |
'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'PR', 'PW', 'RI', 'SC', | |
'SD', 'TN', 'TX', 'UT', 'VA', 'VI', 'VT', 'WA', 'WI', 'WV', 'WY', |
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
#!/usr/bin/python | |
from itertools import combinations | |
class NumberGame: | |
def Run(self, small_cards): | |
self.small_cards = small_cards | |
self.large_cards = [25, 50, 75, 100] | |
self.sols = {} | |
self.counts = {} |