Description
Solve problems from the number round of the Countdown game show.
Description
Solver for the numbers round of the Countdown game show:
That is, given six numbers and a target number, find an arithmetical expression containing exactly those six numbers that yields the target number. The solver however is neither limited to a certain number of operands nor to a certain magnitude of numbers nor to uniqueness of the operands. Please note, that the solver also emits solutions where not all of the given operands are used.
Example:
$ countdown-numbers-solve 23 42 3 4 5 --result 777
(23*3+5)*42/4
The solver employs a brute-force search, but ensures that expressions are unique up to commutativity and associativity. It determines all solutions of a problem within seconds.