Draw FBD for all the given blocks.
Find acceleration.
Applying NLM,
for 3 kg mass, 3g−kx=3a …(i)
for 1 kg mass, kx+g−T=a …(ii)
for 2 kg mass, T−2g=2a …(iii)
Adding (i),(ii),(iii), we get
a=(g3)
Find the extension in the spring.
Given, spring constant k=100 N/m
Using equation (i)
3g−kx=3(g3)
x=2gk=2×10100
Hence, x=0.20 m
Final answer : 0.20