C++ solution using only min/max functions, O(1) time and space.
\t vector numMovesStones(int a, int b, int c) {\n        int sum = a + b + c;\n        int x = min(a, min(b,c));\n        int z = max(a, max(b,c));\n        int
\t vector<int> numMovesStones(int a, int b, int c) {\n        int sum = a + b + c;\n        int x = min(a, min(b,c));\n        int z = max(a, max(b,c));\n        int y = sum - x - z;\n        \n        if(sum == 3*x + 3)\n            return {0,0};\n        \n        int minMoves = min(y-x, z-y) <= 2 ? 1 : 2;\n        int maxMoves =  z - x - 2;   \n        \n        return {minMoves, maxMoves};\n    }
[]