[C++] My super easy to understand solution with explaination
Min  - 3 values possible only \n0 -> when z - x = 2 i.e all elements are consecutive\n1-> when 2 elements are consecutive or there is only 1 integer space betwe
**Min**  - 3 values possible only \n**0 -> when z - x = 2 i.e all elements are consecutive**\n**1-> when 2 elements are consecutive or there is only 1 integer space between any 2 numbers x, y or z**\n**2-> in all other cases**\n \n**Max** - (z - x - 2) because on position exactly equal to x, y, z value movement is not possible and x and z will always move inward direction hence there are only z - x - 2 possible movements\n\n```\nclass Solution {\npublic:\n    vector<int> numMovesStones(int a, int b, int c) {\n        vector<int>num({a, b, c});\n\t\t\n        sort(num.begin(), num.end());\n\t\t\n        int mini = 0;\n\t\tint maxi = num[2] - num[0] - 2;\n\t\t\n\t\t//Case 1\n        if(num[2] - num[0] == 2) return {mini, maxi};\n\t\t\n\t\t//Case 2 & 3 covered here\n        mini = min(num[1] - num[0], num[2] - num[1]) <= 2 ? 1 : 2;\n\t\t\n        return {mini, maxi};\n    }\n};\n``` \n
[]