This is probably from India's CAT. Questions from that test tend to have four answers and be poorly worded, but also to demand more sophisticated reasoning than GMAT questions do. Even by the standards of some of the most poorly worded questions from that test, however, this one is awful! (How can the distance between two trees four columns away be 2, while the distance between two threes three columns away is also 2? Fire the author!)
Anyway, let's consider the problem. I think the author must mean that the distance between any two ADJACENT trees in the same row is 2, and the distance between any two ADJACENT trees in the same column is 2.
Given that, we have 12 columns, so there are 11 two-meter distances between them, or 11*2. We also have a one-meter distance at each end of the garden, or 1*2. Summing up, we've got 11*2 + 1*2, or 24.