Sort:  

apple is 10
and 10 + ? +? =18
each banana is 4

Its a trick problem, each banana is counted separate. Which Is why in the last problem the banana has 3 instead of 4.