Part a) is no different from asking "How many function are there from a set of ten to a set of 3"?

Part b) is more complicated. Here we must assume that at least one box is not empty. "How many ways can 10 be partitioned into three or fewer summonds"?

Here are some examples. .

That is not an easy task.