Let's call the number of rows 'R' . (Clever ?)
There are (3x -2) trees in each row, and there are 'R' rows,
so the total number of trees is [ R times (3x-2) ].
But the problem told you that the total number of trees is (24x-16).
So
R(3x - 2) = (24x - 16)
For a quick, happy ending, how about factoring '8' out of the right side:
R(3x - 2) = 8(3x - 2)
Is it jumping out at you yet ?
If not, then divide each side by (3x - 2) :
R = 8
There are eight (8) rows of trees.