Five programming problems every Software Engineer should be able to solve in less than 1 hour
Geoff Canyon
gcanyon at gmail.com
Sun May 10 11:21:23 EDT 2015
On Sun, May 10, 2015 at 5:38 AM, Mark Waddingham <mark at livecode.com> wrote:
> ---- PROBLEM 5
> ---- At first sight this one seems 'scary' but in actual fact the
> ---- number of combinations is actually quite small (3^8) and you
> ---- can get them by counting from 0 to 3^8 in ternery and padding
> ---- the result to 8 digits. I then use 0 for no sign, 1 for + and
> ---- 2 for -. Having 'value' makes checking the sums trivial.
>
I thought briefly about doing this but it didn't gel in my mind as quickly
as the substitution method I used. I quite like how this turned out!
More information about the use-livecode
mailing list