This is a special right triangle called a 45-45-90 triangle. For 45-45-90 triangles, the hypotenuse is always the size of one leg times √2. Also, the two legs are always equal.
So since we know one leg is √2, then obviously with our new information we know the second leg has to be √2.
So first, x = √2.
Second, we know our hypotenuse is x√2. Well, now we know what x is so let's plug it all in.
y = √2 x √2
√2 x √2 = 2
So x = √2 and y = 2
Hope this helps!