The question says that the students of the school have to select at least 2 subjects from the pool of 3 subjects. This means that Only Math = 0, Only Chem = 0, Only Physics = 0.
Let us call the number of students who have taken all three as k, and k = 18 (Given).
Let us consider, those who have taken both Math and Physics only as p, Math and Chem only as q, and Physics and Chem only as r.
It is given in the question the number of students who have selected Mathematics as one of their selections is 23.
Therefore p+q+k=23
Since k = 18
Therefore, p+q=5
It is also given that number of students who have selected Physics as one of their selections is 25.
Therefore p+r+k=25
p+r=7
Subtract : (p+r)-(p+q) = 7-5
Therefore: r-q=2
We need to find minimum number of students who have taken chem. We know chem is r+k+q.
We also know that k = 18 and that r>q (r-q=2)
Since we can not change k, and considering r>q and can not be minimised below q, so only q can be made minimum which in this case can be 0 if r = 2.
With that we get Minimum students in Chem as r+k+q = 2+18+0 = 20.