Step 1: Understand the moment of maximum stretch.
Two equal blocks fly apart and stretch the spring. At the instant of largest stretch, both blocks momentarily stop moving relative to the spring, so at that point all the moving energy has turned into spring energy.
Step 2: Find the total starting kinetic energy.
Each block has kinetic energy $\tfrac12 mV^2$, and there are two of them. \[ KE = 2 \times \tfrac12 mV^2 = mV^2 \]
Step 3: Write the spring energy at full stretch.
If the stretch is $x$, the spring stores \[ PE = \tfrac12 K x^2 \]
Step 4: Apply energy conservation.
No energy is lost, so starting kinetic energy equals stored spring energy. \[ \tfrac12 K x^2 = mV^2 \]
Step 5: Solve for the stretch.
Multiply both sides by $2$. \[ K x^2 = 2mV^2 \] \[ x^2 = \frac{2mV^2}{K} \]
Step 6: Take the square root.
\[ x = \sqrt{\frac{2mV^2}{K}} \] \[ \boxed{\sqrt{\dfrac{2mV^2}{K}}} \]