Skip to content

Instantly share code, notes, and snippets.

View hielscher's full-sized avatar

Eric hielscher

View GitHub Profile
@hielscher
hielscher / abbreviations.txt
Created September 14, 2019 01:43
fivethirtyeight.com The Riddler solution output for Sept 13, 2019
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
@hielscher
hielscher / abbreviations.py
Created September 14, 2019 01:41
fivethirtyeight.com The Riddler solution for Sept 13, 2019
#!/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',
#!/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 = {}