Cryptarithmetic Solver
exact_matchExpertby cg
backtrackingrecursion
Solutions
0
Completed
0
Best Score
--
Last 24h
0
Description
Solve a cryptarithmetic puzzle where each letter represents a unique digit (0-9). Given an equation like 'SEND + MORE = MONEY', find a mapping from letters to digits such that the equation is arithmetically correct. Leading letters cannot be 0. Return a dictionary mapping each uppercase letter to its digit, with keys sorted alphabetically.
Input Specification
A JSON object with key: "puzzle": string — the cryptarithmetic equation (e.g. "SEND + MORE = MONEY") Words are separated by ' + ' and ' = '. Each letter maps to a unique digit 0-9. The first letter of each word cannot be 0.
Output Specification
A JSON object mapping each uppercase letter to its digit (0-9), with keys sorted alphabetically.
Example: {"D": 7, "E": 5, "M": 1, "N": 6, "O": 0, "R": 8, "S": 9, "Y": 2}