in reply to Re: Re: Words that equal numbers
in thread Words that equal numbers
Well to make my solution a little less "brute" and a bit more smart, only check the combinations where the sum of all digits is equal to 45, which is the sum of the digits one to nine.
This should save some time.
I really wonder if using a permutation engine would be that much faster as it takes time to generate the 10! combinations as well.
In any case my proposed solution woudl work equally well (and probably even better) with the generated list of allowable permutations.
I have a feeling that hardcoding the problem into a PERL script with all constraints will take much longer. At least my solution is more general.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Words that equal numbers
by tall_man (Parson) on Jan 19, 2003 at 01:29 UTC | |
by CountZero (Bishop) on Jan 19, 2003 at 09:06 UTC |