# Puzzle – Label The Fruit Boxes

There are three boxes, one contains only apples, one contains only oranges, and one contains both apples and oranges. The boxes have been incorrectly labeled such that no label identifies the actual contents of the box it labels. Opening just one box, and without looking in the box, you take out one piece of fruit. By looking at the fruit, how can you immediately label all of the boxes correctly?

Fruits Puzzle

### Solution:

• First, take a fruit from the box labeled “apples and oranges.” Let’s say you pick an apple.
• Now, since this box cannot contain only apples (as it is mislabeled), and you have just removed an apple, it must contain oranges as well. Therefore, you can relabel this box as “oranges.”
• The box labeled “oranges” cannot contain only oranges (as it is mislabeled) and it can’t contain both oranges and apples (since you have just removed an apple from the box labeled “oranges and apples”). Therefore, this box must contain only apples. You can relabel this box as “apples.”
• Finally, the box labeled “apples” cannot contain only apples (as it is mislabeled) and it can’t contain both oranges and apples (since you have just removed an apple from the box labeled “oranges and apples”). Therefore, this box must contain both oranges and apples. You can relabel this box as “oranges and apples.”
• By just removing one fruit from a box, you can correctly relabel all three boxes.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Previous
Next