A garden has the shape of a right triangle with one leg 6 meters longer than the other. The hypotenuse is 6 meters less than twice the length of the shorter leg. Find the length of the shorter leg.