see the picture attached to better understand the problem
we know that
in the right triangle ABC
cos A=AC/AB
cos A=1/3
so
1/3=AC/AB----->AB=3*AC-----> square----> AB²=9*AC²----> equation 1
applying the Pythagoras Theorem
BC²+AC²=AB²-----> 2²+AC²=AB²---> 4+AC²=AB²----> equation 2
substitute equation 1 in equation 2
4+AC²=9*AC²----> 8*AC²=4----> AC²=1/2----> AC=√2/2
so
AB²=9*AC²----> AB²=9*(√2/2)²----> AB=(3√2)/2
the answer is
the hypotenuse is (3√2)/2