use tangent to solve this problem
let d the distance of the boat
first let solve the x for the height of 35 degrees elevation
and in terms it in d
tan35 = x/d
x = dtan35
then for the 42 degree
and the opp of this situation is the sum of the height of the lighthouse plus x, and we have the value of x
so the equation become
tan42 = (20 + dtan35) /d
solving more by algebra
you will get
d = 99.9 m far the boat from the cliff