In fact, it WAS a homework couple of years ago, and I've solved it, kind of (below). I still would like to find a cleaner solution.
Here is what I did.
Let's say, the apples are labeled, and their weights are ##x_1, x_2, ...##. He takes out the apple #1 and finds that, e.g., ##x_2+x_5+x_9+... =...