Have you made a sketch? Also, I'm assuming here that both ships are to the east of the lighthouse, for there would be too many solutions otherwise.

If you have, then the solutions will come by themselves. The only things you need here is :

OPP is the opposite side to the angle and ADJ is the adjacent side. It's easier of you work with the angle between whole lighthouse and the line of sight of your observer (that is remove the concerned angle from 90 degrees).

Then, when you find the distances of both ships from the lighthouse, you find their distance apart by subtracting the closer from the further distance.

Post your answer, please. :)