simple logic explained 100%beats
Intuitionwe need to deal with the gaps between elements
4 casesApproachsort the stones into start mid and end
calculate gaps between two stonescase I: both gaps
# Intuition
we need to deal with the gaps between elements
4 cases

# Approach
sort the stones into start mid and end
calculate gaps between two stones

case I: both gaps are zero, in this case all are consective no need to do anything

case II: one gap is zero and one isnt (generalized)
if one gap is zero, two number are consective
min ways is simply move the separated number next to them -> 1 way
max ways is make it move through each gap
example:  X Y _ _ _ Z
min is X Y Z _ _ .
max is X Y _ _ Z . -> X Y _ Z . . -> X Y Z . . .
3 ways which is number of gaps

case III: any one of the gaps is exactly 1
then min ways is 1, but max ways is sum of gaps

case IV: both gaps are greater than 1
min ways is 2, max is sum of gaps


# Complexity
- Time complexity:
O(1)
- Space complexity:
O(1)
# Code
```cpp []
class Solution {
public:
    vector<int> numMovesStones(int a, int b, int c) 
    {
        int start = min(a,min(b,c));
        int end = max(a,max(b,c));
        int mid = a+b+c-start-end;
        
        int gap1 = mid - start - 1, gap2 = end-mid - 1;

        if(gap1==0 && gap2==0)
            return {0,0};
        else if((gap1>0 && gap2==0) || (gap1==0 && gap2>0))
            return {1,max(gap1,gap2)};
        else if(gap1==1 || gap2==1)
            return {1,gap1+gap2};
        else
            return {2,gap1+gap2};
   
    }
};
```
['C++']