Coding challenge

Mark Wieder mwieder at ahsoftware.net
Thu Jan 31 10:43:45 EST 2013


Alex-

Thursday, January 31, 2013, 6:53:36 AM, you wrote:

> The question was
>> Determine the minimum number of coins for change.
> so the correct answer here would be 2 coins (3+3) rather than 6 coins
> (1+1+...)

> That's what makes this a more challenging case, but probably without as
> elegant an answer ...

In any of the submitted examples, replacing the string
"50,20,10,5,2,1" with "40,30,10,4,3,1" does the right string. No more
challenging than the original question.

And yes, the minimum number of coins to represent 6 in this case is
3+3 and the next in line would be 4+1+1. And then six coins.

-- 
-Mark Wieder
 mwieder at ahsoftware.net





More information about the use-livecode mailing list