Coding challenge

dunbarx at aol.com dunbarx at aol.com
Thu Jan 31 13:03:48 EST 2013


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 <pderocco at ix.netcom.com>
To: 'How to use LiveCode' <use-livecode at 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:pderocco at ix.netcom.com 


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

 



More information about the use-livecode mailing list