form an equation using the information given.
x = number of sets in a row
x - 7 = number of rows
x(x - 7) = 638
x^2 - 7x = 638
make a quadratic equation
x^2 - 7x - 638 = 0
then solve either using quadratic equation or find two numbers that add to make -7 and multiply to make -638, one number is negative and one is positive, as the product of the numbers is negative.
-29 + 22 = -7
-29 x 22 = -639
then put into brackets
(x - 29)(x + 22) = 0
when the equation equals zero you can find two values for x
x = 29 or -22