In the story, the young Ibn Umar worked it out but was too shy to speak in front of his elders, so the Prophet gave the answer himself.