Since $OA=AB$, let us find OA first. $OA=\sqrt{(18-0)^2+(3-0)^2}=3\sqrt{37}$. So, $AB=3\sqrt{37}$. So, $$\sqrt{(15-18)^2+(k-3)^2}=3\sqrt{37}$$ $$\implies(-3)^2+(k-3)^2=333$$ $$\implies k^2-6k+9=324$$ $$\implies k^2-6k-315=0$$ $Using\\calculator$ $$k=21$$ or, $$k=-15$$
Is my solution correct?
I'm asking this because my book only mentions k=21 but not k=-15. But I don't find k=-15 to be an extraneous root as the equation holds true using -15 as the solution as well. So will the answer be both 21 and -15 or only -15?
If there's any problem in my question please let me know. Thanks in advance!

The graph shows several explicit-implicit conditions. One of them is the angle $\angle OAB=90^\circ$. Refer to the graph:
$\hspace{4cm}$
Note that $\angle OAC\ne 90^\circ$.
Also note that just because the point $B$ is in the first quadrant does not automatically imply the second root is extraneous. If the whole graph is shifted over $15$ units upward, the point $C$ (or the second root) will also be in the first quadrant, but then it must be ignored by the condition of the right angle.