Answer:
Opportunity cost is the cost of the lost alternative. It can be calculated by,

The country which has a lower opportunity cost is said to have a comparative advantage in producing a good.
In this case,
The opportunity cost of producing Turnip for the two producers is,
For selkirk-
1 Clam
For Pirate Jack-
Clam
While, the opportunity cost of producing Clam for the two is given by,
For selkirk-
1 Turnip
For Pirate Jack-
Turnips
Therefore, as can be seen the opportunity cost of producing Turnip is lower for Pirate Jack. So, Pirate Jack has a comparative advantage in Turnips.
While, Selkirk has a lower opportunity cost in digging clams so, it has a comparative advantage in Clams.