Easy solution using C
IntuitionApproachComplexity
Time complexity:

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

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

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

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

# Code
```c []
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int*numMovesStones(int a,int b,int c,int*returnSize){
    int*x=(int*)malloc(3*sizeof(int));
    x[0]=a;x[1]=b;x[2]=c;
    for(int i=0;i<2;i++)
        for(int j=i+1;j<3;j++)
            if(x[i]>x[j]){
                int t=x[i];
                x[i]=x[j];
                x[j]=t;
            }
    int l=x[1]-x[0],r=x[2]-x[1];
    int*res=(int*)malloc(2*sizeof(int));
    res[0]=(l==1&&r==1)?0:(l<=2||r<=2)?1:2;
    res[1]=l-1+r-1;
    *returnSize=2;
    return res;
}
```
['Math', 'Brainteaser', 'C']