<p>There are some stones in different positions on the X-axis. You are given an integer array <code>stones</code>, the positions of the stones.</p>
<p>Call a stone an <strong>endpoint stone</strong> if it has the smallest or largest position. In one move, you pick up an <strong>endpoint stone</strong> and move it to an unoccupied position so that it is no longer an <strong>endpoint stone</strong>.</p>
<ul>
<li>In particular, if the stones are at say, <code>stones = [1,2,5]</code>, you cannot move the endpoint stone at position <code>5</code>, since moving it to any position (such as <code>0</code>, or <code>3</code>) will still keep that stone as an endpoint stone.</li>
</ul>
<p>The game ends when you cannot make any more moves (i.e., the stones are in three consecutive positions).</p>
<p>Return <em>an integer array </em><code>answer</code><em> of length </em><code>2</code><em> where</em>:</p>
<ul>
<li><code>answer[0]</code><em>is the minimum number of moves you can play, and</em></li>
<li><code>answer[1]</code><em>is the maximum number of moves you can play</em>.</li>