Let W=amount in kg of walnuts and P=same for peanuts.
W+P=39 total amount. So P=39-W.
0.51W+0.6P=0.57×39 equates values in money.
Now substitute for P:
0.51W+0.6(39-W)=22.23, 0.51W+23.4-0.6W=22.23.
1.17=0.09W, W=1.17/0.09=117/9=13kg.
So there is 13kg of walnuts in the mixture (and 26kg of peanuts).