Here I rewrite the problem with some corrections and also present a possible answer.
Question
A horizontal force F pushes a 4kg block A which pushes against a 2kg block B. The blocks have an acceleration of 3m/s^2 to the right and there is no friction between the blocks and the surface on which they slide. What is the net force that B exerts on A?
Answer
Let B exerts force f on A then A also exerts same force on B.
Hence considering the net force on A we can write F - f = 4×3 N
Again considering the net force on B we can write f = 2×3 N= 6 N
Hence B exerts 6 N force on A
.