According to cosine theorem
c? =a? +b? -2ab cosC=a? +a? +a? =3a?
(cosC= 120 =-0.5)
C= root number 3 a
That is to say, the distance between lighthouse A and lighthouse B is the root number 3 a(km).