Simple constant time and constant space C++ solution
IntuitionApproachComplexity
Time complexity:o(1)

Space complexity: o(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:o(1)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: o(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    vector<int> numMovesStones(int a, int b, int c) {
        vector<int>temp(3);
        temp[0]=a;
        temp[1]=b;
        temp[2]=c;

        sort(temp.begin(),temp.end());

        if(abs(temp[0]-temp[1])==1 and abs(temp[1]-temp[2])==1){
            return {0,0};
        }
        int cnt = 0 ;
        if(temp[1]-temp[0]==1 and temp[2]-temp[1]!=1){
            int val = temp[2]-temp[1]-1;
            return {1,val};
        }
        else if(temp[2]-temp[1]==1 and temp[1]-temp[0]!=1){
            int val = temp[1]-temp[0]-1;
            return {1,val};
        }
        else if(temp[1]-temp[0]==2 or temp[2]-temp[1]==2){
            int val1 = temp[1]-temp[0];
            int val2 = temp[2]-temp[1];
            int val3 = max(val1,val2);
            return {1,val3};
        }
        int val1 = temp[1]-temp[0]-1;
        int val2 = temp[2]-temp[1]-1;
        int val3 = val1+val2; 
        return {2,val3};
    
    }
};
```
['Math', 'Brainteaser', 'C++']