The question is shared to me by my physics teacher, we have never solved it:
Imagine a spring standing vertically with one end pressed on the table, now you press down the spring from the upper end by x meter, then you remove your hand. Now if the compression is enough, the spring could raise its bottom off the table. It asks: what is the max height the top of the spring will reach.
There are point masses M1, M2 attached at bottom and top of the massless spring respectively. You are given that spring has natural length L, spring constant k, initially compressed by x meter, gravitational acceleration g.
I don't see a clear way to solve this, my best attempt was to produce a simulation as in the gif, but it didn't clear up much things. My best hope is a expression in terms of those parameters that expresses this max height.
Link to simulation: https://www.desmos.com/calculator/7mvofzasjn
Edit: I have seen people posting answers, but what they didn't realize is that the spring can be very stretched or compressed when the top of the spring is at its highest! This means there is EPE leftover in the spring. But how much? That would depend on how stretched it is then, which one probably would determine when one really solved the problem.