Three stones are located at distinct integer positions a, b, and c on a number line.
In one move, a stone situated at an endpoint (either the minimum or maximum position among the three) may be shifted to any unoccupied integer position strictly between the other two stones. Moves continue until all three stones occupy consecutive integer positions, at which point no further moves can be made.
Return an array answer of length answer[0] is the minimum number of moves and answer[1] is the maximum number of moves possible until the stones are consecutive.
Constraints:
a, b, and c have distinct values.
Three stones are located at distinct integer positions a, b, and c on a number line.
In one move, a stone situated at an endpoint (either the minimum or maximum position among the three) may be shifted to any unoccupied integer position strictly between the other two stones. Moves continue until all three stones occupy consecutive integer positions, at which point no further moves can be made.
Return an array answer of length answer[0] is the minimum number of moves and answer[1] is the maximum number of moves possible until the stones are consecutive.
Constraints:
a, b, and c have distinct values.