code challenge: generate minimal expressions using only digits 1,2,3
luke.dunn at gmail.com
Fri Feb 20 17:30:10 CET 2009
On 20 Feb, 16:02, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> Trip Technician <luke.d... at gmail.com> writes:
> > I have a dim intuition that it could be done with a very clever bit of
> > recursion, but the exact form so far eludes me.
> This sounds a little like a homework assignment, or maybe a challenge
> you are trying to solve for yourself, rather than be given a complete
> answer for. Anyway, the basic idea is to enumerate the expression
> trees with 1 digit, then 2 digits, then 3 digits, etc, and compute the
> value expressed by each tree.
Thanks will get onto it. It's just a challenge I set myself so hints
only are cool.
More information about the Python-list