Java simple solution
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] numMovesStones(int a, int b, int c) {\n        int result[] = new int[2];\n        int x  = min(a, b, c);\n        int y = mid(a, b, c);\n        int z = max(a, b, c);\n\n        if(x + 1 == y && y + 1 == z){\n            result[0] = 0;\n            result[1] = 0;\n            return result;\n        }\n        result[0] = (y - x <= 2 || z - y <= 2) ? 1 : 2;\n        result[1] = z - x - 2;\n\n        return result; \n    }\n\n    private int min(int a, int b, int c){\n        if( a < b && a < c) return a;\n        else if( b < a && b < c) return b;\n        else return c;\n    }\n\n    private int max(int a, int b, int c){\n        if( a > b && a > c) return a;\n        else if(b > a && b > c) return b;\n        else return c;\n    }\n\n    private int mid(int a, int b, int c){\n        int min = min(a, b, c);\n        int max = max(a, b, c);\n\n        if( a != min && a != max) return a;\n        else if(b != min && b != max) return b;\n        else return c;\n    }\n}\n```
['Java']