The exercise is about making a software to manage a Robot Factory.
In my program I can create single parts and then robots with them but I also can have robots with smaller robots inside. That's where the Composite comes in. In fact the Component class could be a Part and the Composite class the Robot that implements a list of Parts and inherits from the Part class (that's because a robot can also be made from a single part)
Everything points to this solution but the problem comes when they told us that there are 2 types of Parts; Terrestrial and Aquatic and a Robot cannot be made with different types of parts.
I don't know if this is actually a viable way because the diagram implies I can have a Robot made with both kind of parts even though I'm going to limit it within the code.
Here's an UML diagram

