Just apply work energy theorem to this question and you will get the answer easily.
First equate Work done by gravitational force + Work Done by Spring force = Change in Kinetic energy
Now you find the x. Then according by the formula of potential energy you can easily find the maximum potential energy and hence your answer will be matched.
Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile