
net upward $=$ net downward force
$F_{s}+F_{b}=W$
where
$F_{s}=$ force due to compression in the spring
$F_{b}=$ buoyant force
$W=$ weight of the cylindrical block
$\Rightarrow k x+A L \frac{\rho}{3} g=A L \rho g$
$\Rightarrow k \frac{L}{3}+A L \frac{\rho}{3} g=A L \rho g$
$\Rightarrow k \frac{L}{3}=\frac{2 A L \rho g}{3}$
$\Rightarrow k=2 \rho A g$
