This is how I went about it, although I got a wrong answer:
3,5-Dimethyl-4-nitrophenol (2) shows the nitro group to be sterically hindered, due to which it should go out of plane and this will be an example of the steric inhibition of resonance. Hence, there will only be a weak withdrawing inductive effect, and no resonance. Thus, this should be the least acidic.
4,5-Dimethyl-2-nitrophenol (3) shows a hydrogen bonding between the nitro and the hydroxyl group, due to which there will be a lower tendency to release the proton. Hence, even this should be less acidic.
Between 2,6-dimethyl-3-nitrophenol (1) and 2,4-dimethyl-5-nitrophenol (4), (1) should be weakly acidic due to the hyperconjugation destabilisation caused by the two methyl groups, and hence the answer should be (4), with lower hyperconjugation, lower induction from the methyl groups, and higher induction from the nitro group (no resonance at the meta position).
However, the answer is given to be (2), which I ruled out first.
Can someone please explain what is happening, and where I've gone wrong?