acceleration can be found using net pulling force method
acceleration = net pulling force /total mass 2 be pulled
=32N - 20N / 3 kg
= 4m/s^2
consider FBD of the 20cm part
it is accelrated to the right by 4 m/s^2
T of the string acts in the direction of acceleration=32 N
contact force also acts in the same direction------>f {by 10 on 20}
f + 32 = 2(mass of 20 cm part) * 4(acceleration towards right)
f = -24 N ,which is force by 10 on 20
force by 20 on 10 = -f = 24 N