Skip to content

Instantly share code, notes, and snippets.

@zahash
Created January 5, 2019 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zahash/6f0753209b142f5da54532bd7a1deccc to your computer and use it in GitHub Desktop.
Save zahash/6f0753209b142f5da54532bd7a1deccc to your computer and use it in GitHub Desktop.
def only_choice(grid_dict):
for unit in unit_list:
for num in '123456789':
num_places = [box for box in unit if num in grid_dict[box]]
if len(num_places) == 1:
grid_dict[num_places[0]] = num
return grid_dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment