According to question ,
A is 7th from the left and B is 9th from the right.
After interchanging their positions ,
Now A becomes 11th from the left.
∴ Total number of people in the row = A's position + B's position - 1
Total number of people in the row = 11 + 9 – 1 = 19