To solve this you need to use the Pythagorean theorum, , where c is the length of rope needed and A and B are the side lengths. Think of it like a right triangle.
So, the equation is
Which is then
And the possible values of c are 20 and -20.
From here we know the answer cannot be -20 because you cannot have a negatively long length of rope, so the answer must be 20 feet.