Answer:
The speed of the block when it separates from the spring will be

Step-by-step explanation:
Using the Principle of Conservation of Energy, and taking into account that we have a system of a spring and a block that we can analyze, we can say that in two different instants, the energy must be constant.
Now, we can think in the initial moment, when the spring is compressed and the block is against it, and write its energy as potential energy because the kinetic energy is zero as they are not moving:

where k is the spring constant, and x is the length of compression of the spring (this length will be expressed in m instead of cm to be consistent with the units).
Then we can go to the final moment when the block is "separating" from the spring, and in that moment the potential energy will be zero, and all energy will be kinetic, wich we can write as

where m is the mass of the block, and v is its speed (this is what we want to calculate). Therefore, we can equalize both expressions, and clear v

Finally, we have that

wich is the speed of the block when it separates from the spring.