looping through possible combinations of McNuggets packs of 6,9 and 20

News123 news1234 at free.fr
Thu Aug 12 09:39:32 CEST 2010


Hi Steven,

On 08/12/2010 01:37 AM, Steven D'Aprano wrote:
> On Wed, 11 Aug 2010 13:14:35 -0700, Baba wrote:
> 
>> level: beginner
>>
>> exercise: given that packs of McNuggets can only be bought in 6, 9 or 20
>> packs, write an exhaustive search to find the largest number of
>> McNuggets that cannot be bought in exact quantity.
> 
> Is this a trick question?
> 
> I'd like to see somebody try to buy exactly 10**100**100 (1 googleplex) 
> McNuggets. And that's not even close to the largest number that you can't 
> buy.

You CAN buy that many Nuggets.

You just need the money and of course you have to wait a little until
they are ready.




More information about the Python-list mailing list