Martha had bought only 23 cent pencil and only 21 cent pencil.
How many 23 pencils are purchased?
Statement I
Total number of pencils purchased =6
cannot deduce anything from this, therefore insufficient.
Statement II
Total amt. of pencils purchased = 130
=> 23x+21y=130
Only values that can satisfy the above equation is x =2 & y=4.
You only have to look at the units digit to find the value of x and y.
both the value can only end in either 5 or 0 or 6 and 4 to get the number whose unit digit is 0. 5 and 0 cannot be possible because if added the number would exceed 130, hence
23*2+21*4 = 130
Therefore sufficient.
Hence B is the answer.