readable O(1) T & S
Code\n\nclass Solution {\npublic:\n    vector<int> numMovesStones(int a, int b, int c) {\n        int pos[] = {a, b, c};\n        sort(pos, pos + 3);\n        v
# Code\n```\nclass Solution {\npublic:\n    vector<int> numMovesStones(int a, int b, int c) {\n        int pos[] = {a, b, c};\n        sort(pos, pos + 3);\n        vector<int> res(2);\n        int diff1 = pos[1] - pos[0], diff2 = pos[2] - pos[1];\n        res[1] = (diff1 - 1) + (diff2 - 1);\n        if(diff1 == 1 && diff2 == 1) res[0] = 0;\n        else if(diff2 == 1 || diff1 == 1) res[0] = 1;\n        else if(diff1 == 2 || diff2 == 2) res[0] = 1;\n        else res[0] = 2;\n        return res;\n    }\n};\n```
['Math', 'Brainteaser', 'C++']