@@ -0,0 +1,1128 @@
+#!/usr/bin/env python%0A%22%22%22%0ANPR 2019-01-27%0Ahttps://www.npr.org/2019/01/27/688759364/sunday-puzzle-slogan-scramble%0A%0AName a vehicle in two words, each with the same number of letters. %0ASubtract a letter from each word, and the remaining letters in order will %0Aspell the first and last names of a famous writer. Who is it?%0A%22%22%22%0Aimport sys%0Asys.path.append('..')%0Aimport nprcommontools as nct%0A%0A#%25%25%0Avehicles = nct.wikipedia_category_members('Motor_vehicles_manufactured_in_the_United_States',max_depth=2)%0A#%25%25%0Acurated_vehicles = set(x for x in vehicles if x.count(' ') == 1 and len(x.split(' ')%5B0%5D) == len(x.split(' ')%5B1%5D))%0A%0A#%25%25%0Anames = nct.get_famous_names(95)%0Aname_dict = nct.make_sorted_dict(names)%0Aname_keys = frozenset(name_dict.keys())%0A#%25%25%0Afor vehicle in curated_vehicles:%0A    vehicle = vehicle.lower()%0A    v1,v2 = vehicle.split(' ')%0A    if v1.isalpha() and v2.isalpha():%0A        for i in range(len(v1)):%0A            for j in range(len(v2)):%0A                sorted_string = nct.sort_string(v1%5B:i%5D+v1%5Bi+1:%5D + v2%5B:j%5D+v2%5Bj+1:%5D)%0A                if sorted_string in name_keys:%0A                    print(vehicle,name_dict%5Bsorted_string%5D)%0A%0A

Create 0127_vehicle_author.py