let the number of bags that he would have been used to put 3 kg of apples be x. Thus the number of bags that would be used to put 2kgs will therefore be (x+9), hence the total number of kgs the bags will hold will be given by:
3*x=3x kgs
2(x+9)=(2x+18) kgs
since the total weights are the same then:
2x+18=3x
hence
18=3x-2x
18=x
thus the number of bags required to put 3 kgs of apples will be 18. Thus the total Kgs of apples was:
3x
=3*18
=54 kgs