Correct Answer - `4 J`
At maximum compression of spring, velocities of block B and C are same (say `v_(0)` )
then by conservation of linear momentum `3(2) = (3 + 6)v_(0) rArr v_(0) = (2)/(3) m//s`
At this instant energy stored in spring `= (1)/(2)(3)(2)^(2) -(1)/(2)(3 + 6)((2)/(3))^(2) = 6 - 2 = 4 J`