All solutions here are SUGGESTED. Mr. Teng will hold no liability for any errors. Comments are entirely personal opinions.
By Pythagoras’ Theorem,
When $latex x = 8, y = 6 < x$, which is not possible given the question. Thus, rejected. $latex \therefore, x=4, y=18$
Students need to be alert to reject the appropriate x-value. Alternatively, they can also check the second order derivative to determine which is the suitable x value.