I've just finished problem set 2 - question 4: can someone check it for me...? somehow it gets so long and its kinda weird...i just learned for 2 days so dont know many codes...

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

I've just finished problem set 2 - question 4: can someone check it for me...? somehow it gets so long and its kinda weird...i just learned for 2 days so dont know many codes...

MIT 6.00 Intro Computer Science (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

I just finished this assignment myself, so I may not have enough experience to help you fully. What are your packet sizes? From looking at your code, it looks like they are 10, 20, 50. Your code says that the largest quantity you can't buy exactly is 53. But you can't buy 54 nuggets, can you?
oh actually it was actually 7, 10, 20 haha the 50 is the size of tested x because i break the problem into bracket [0,50] [51,100] and [101,150] to avoid testing too many cases so i set x = 50 at first to test whether 50 is larger than the largest quantity or not

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Oh, my mistake. Your code seems to work when I use it, but I can't really help you because you use functions, which I am just now learning about and are not necessary for solving this problem.
oh thanks anyway (well did i use any function...? lol...) im at the beginning too so yea...

Not the answer you are looking for?

Search for more explanations.

Ask your own question