Python3 Fun Brain Teaser Problem Constant Time, Space Approach
# Intuition and Approach\nSort the stones and think about being as greedy as possible\nInvariant : min moves in set [0,1,2]\nmax moves : if two stones were moved all the way to one end, and one stone was left on the other end\n\n# Complexity\n- Time complexity:\n$$O(1)$$\n\n- Space complexity:\n$$O(1)$$\n\n# Code\n```python3 []\n\'\'\'\nURL := https://leetcode.com/problems/moving-stones-until-consecutive/description/\n1033. Moving Stones Until Consecutive\n\'\'\'\nclass Solution:\n    def numMovesStones(self, a: int, b: int, c: int) -> List[int]:\n        stones = [a,b,c]\n        stones.sort()\n        print(stones)\n        stoneOne = stones[0]\n        stoneTwo = stones[1]\n        stoneThree = stones[2]\n        gapSizeOne = abs(stoneOne - stoneTwo)\n        gapSizeTwo = abs(stoneTwo - stoneThree)\n        minMoves = 2\n        if(gapSizeOne <= 2 or gapSizeTwo <= 2):\n            if(gapSizeOne == 1 and gapSizeTwo == 1):\n                minMoves = 0\n                maxMoves = 0\n                return [0,0]\n            else:\n                minMoves = 1\n        gameLength = abs(stoneThree - stoneOne)\n        maxMoves = gameLength - 2\n        answers = [minMoves,maxMoves]\n        return answers\n\n        \n```
['Math', 'Brainteaser', 'Python3']