Let the cost price of peanuts per kg be $\text{Rs}. x.$
Then, the cost price of walnuts per kg be $\text{Rs}. 3x.$
A wholesaler sold $8 \; \text{kg}$ of peanuts at a profit of $10\%.$
So, the cost price of $8 \; \text{kg}$ peanuts $ = \text{Rs}. 8x.$
Therefore, selling price of $8 \; \text{kg}$ peanuts $ = 8x \times \frac{110}{100} = \text{Rs.} \frac{88x}{10} $
And, he also sold $16 \; \text{kg}$ walnuts at a profit of $20 \%.$
So, the cost price of $16 \; \text{kg}$ walnuts $ = 16 \times 3x = \text{Rs.} 48x $
Therefore, selling price of $16 \; \text{kg}$ walnuts $ = 48x \times \frac{120}{100} = \text{Rs.} \frac{288x}{5} $
The shopkeeper who bought the products from the wholesaler lost $5 \; \text{kg}$ of walnuts, and $3 \; \text{kg}$ of peanuts in transit.
So, he finally have $11 \; \text{kg}$ of walnuts, and $5 \; \text{kg}$ of peanuts. He then mixed the remaining nuts, and this brought the total quantity $ = (11 \; \text{kg} + 5 \; \text{kg}) = 16 \; \text{kg}.$
Shopkeeper sold $16 \; \text{kg}$ of mixture at the rate of $\text{Rs.} 166 \; \text{per kg}.$
So, total amount earned by shopkeeper of $16 \; \text{kg} = 16 \times 166 = \text{Rs.} 2656 $
Now, since the shopkeeper made a profit of $25 \%$ on his entire purchase of $8 \; \text{kg}$ of peanuts and $16 \; \text{kg}$ of walnuts.
Thus, $125 \% \left( \frac{88x}{10} + \frac{288x}{5} \right) = 2656 $
$ \Rightarrow \frac{125}{100} \left( \frac{88x}{10} + \frac{288x}{5} \right) = 2656 $
$ \Rightarrow \frac{5}{4} \left ( \frac{88x + 576x}{10} \right) = 2656 $
$ \Rightarrow \frac{664x}{8} = 2656 $
$ \Rightarrow 83x = 2656 $
$ \Rightarrow x = \frac{2656}{83} $
$ \Rightarrow \boxed{x = 32} $
$ \therefore$ The cost price of walnuts per kg $ = 3x = 3 \times 32 = \text{Rs.} 96 $
Correct Answer $: \text{B}$