Ah.

Paul is right, the descending scheme finds "4,1,1" instead of "3,3", because 
since the "4" is used first this leaves only 1's available for the rest of the 
work. 



Ah.



This is now a more interesting challenge. It requires that the nextmost lower 
value be considered as a candidate. And maybe even lower nextmost ones?




Craig.


-----Original Message-----
From: Paul D. DeRocco <pdero...@ix.netcom.com>
To: 'How to use LiveCode' <use-livecode@lists.runrev.com>
Sent: Thu, Jan 31, 2013 12:55 pm
Subject: RE: Coding challenge


> Mark Wieder
> 
> 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.

Yes, and the examples so far would render 6 as 4+1+1, not 3+3, which is the
wrong answer.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pdero...@ix.netcom.com 


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to