Coding challenge
Dave Cragg
dave.cragg at lacscentre.co.uk
Thu Jan 31 14:59:11 EST 2013
On 31 Jan 2013, at 05:40, Paul D. DeRocco <pderocco at ix.netcom.com> wrote:
> Now how would you do it if the available coin values were:
>
> 40,30,10,4,3,1
>
> That's a more interesting problem, but probably a less interesting coding
> test, because I think it would involve a more brute force approach, less
> elegance.
Right. Not only finding the least number of coins, but also checking that the available coins can be used to create the desired total. The presence of a 1-unit coin should make that so, so long as you check the desired total is an integer. Not all solutions checked for that. Tut tut! :-)
Dave
More information about the use-livecode
mailing list