Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 10 Online
OpenStudy (vaboro):

Gosh! Finally finished problem set 2. Here is my ps2b.py code. Somehow it was more challenging than I expected. I spent couple of days solving the problem. Would appreciate your comments. http://pastebin.com/wkWxHy5v

OpenStudy (anonymous):

The only thing I would add is that you do not need to check each coefficient up to the number of nuggets. For instance, if you were trying to buy 100 nuggets with 20 piece boxes. You do not need to try 20 * 100. Only up to 20 * 5. This will reduce the amount of calculations needed when there isn't a solution.

OpenStudy (vaboro):

thank you, xhaereticusx, I will have a look at it appreciate very much

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!