Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
efficient precomputed solution in Clear category for The Secret Room by juestr
from bisect import bisect
def solutions():
_0to9 = ' one two three four five six seven eight nine'.split(' ')
_0to19 = _0to9 + 'ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen'.split()
_2xto9x = 'twenty thirty forty fifty sixty seventy eighty ninety'.split()
_0to99 = _0to19 + [f'{d} {u}'.rstrip() for d in _2xto9x for u in _0to9]
_0to1000 = _0to99 + [f'{h} hundred {x}'.rstrip() for h in _0to9[1:] for x in _0to99] + ['one thousand']
alphabetical = []
for n in _0to1000:
i = bisect(alphabetical, n)
alphabetical.insert(i, n)
yield i
secret_room = list(solutions()).__getitem__
May 17, 2019
Comments: