Question related to the conservation of mechanical energy?

enter image source here