mohinibansal wrote:

he buys brand x 8 pairs = 8*2 =16$

now in remaining 9$ he buys 3 pairs of brand Y socks which is= 9$

Total Rupees= 16+9=25

Total no. of socks= 8+3=11

You should start by checking which is the maximum number of 2$ socks because they are the cheapest. So, 25/2 = 12.5. Then, if the individual buys 12 pairs of 2$ socks than he remains with 25$-12*2$ = 1$. Thus, it is not the case because he has to spend its entire budget.

Then, we can try with 11 2$ socks. In this case he is left with 25$-11*2$ = 3$, which is exactly the cost of one pair of brand Y socks. Then the maximum number of socks bought with 25$ is 12!