C++ 2 lines
See my latest update in repo LeetCode\n\n## Solution 1.\n\ncpp\n// OJ: https://leetcode.com/problems/moving-stones-until-consecutive/\n// Author: github.com/lzl
See my latest update in repo [LeetCode](https://github.com/lzl124631x/LeetCode)\n\n## Solution 1.\n\n```cpp\n// OJ: https://leetcode.com/problems/moving-stones-until-consecutive/\n// Author: github.com/lzl124631x\n// Time: O(1)\n// Space: O(1)\nclass Solution {\npublic:\n    vector<int> numMovesStones(int a, int b, int c) {\n        int mx = max({ a, b, c }), mn = min({ a, b, c }), mid = a + b + c - mx - mn;\n        return { mid - mn == 2 || mx - mid == 2 ? 1 : (mid - mn > 1) + (mx - mid > 1), mx - mn - 2 };\n    }\n};\n```
[]