Re: solve alphametic puzzles in just 9 lines of code
Sorry, didn't document my code well enough. Here is the code with an example. Yingjie #Code begins### from itertools import permutations def solve(puzzle): """solve alphametic puzzles in just 9 lines of code. Make sure each operator is seperat
solve alphametic puzzles in just 9 lines of code
, Yingjie Code starts here### import itertools def solve(puzzle): "solve alphametic puzzles in just 9 lines of code." words = [w for w in puzzle.split() if w.isalpha()] nonzeros = {w[0] for w in words} others = {a for a in ''.join(words) if a not in