Explanation:
always remember Pythagoras for right-angled triangles :
c² = a² + b²
c is the Hypotenuse (the side opposite of the 90° angle), a and b are the legs.
this principle must be always fulfilled, otherwise it is not a right-angled triangle.
when your have a triangle problem (particularly for a right-angled triangle) with only side information, there is a high chance that you need to use Pythagoras.
in our case
(2×sqrt(3))² = x² + (sqrt(3))²
4×3 = x² + 3
12 = x² + 3
x² = 9
x = 3
that's all.
FYI : sqrt(x²) has actually 2 solutions : -x and +x, as both are squared equal to x².
but a negative number does not make any sense for general side lengths and similar things. so, the positive solution here is the only valid one.