A vertical spring with a spring constant of 450 N/m is mounted on the floor. From directly above the spring, which is unstrained, a 0.30 kg block is dropped from rest. It collides with and sticks to the spring, which is compressed by 3.0 cm in bringing the block to a momentary halt. Assuming air resistance is negligible, from what height (in cm) above the compressed spring was the block dropped?

For Further Reading

Physics - bobpursley, Wednesday, April 4, 2007 at 9:07pm
The spring compression had 1/2 k x^2 of work done on it. Assuming no losses to friction, then the energy that went into it was mg(h+x). Calculate h

Bob, are we solving for h+x or only h. Because solving for only h gives a wrong answer

h+x is the initial height above the COMPRESSED spring, which is what they ask for

Thanks for the clarification