1033. Moving Stones Until Consecutive
IntuitionLooks easy, but not!ApproachWorked on papers and by visualizing different testcases by drawing in papers!Complexity
Time complexity: O(1)

Space comple
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Looks easy, but not!
# Approach
<!-- Describe your approach to solving the problem. -->
Worked on papers and by visualizing different testcases by drawing in papers!
# Complexity
- Time complexity: O(1)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int[] numMovesStones(int a, int b, int c) {

        int x = Math.min(Math.min(a,b),c);
        int z = Math.max(Math.max(a,b),c);
        int y = (a!=x && a!=z)?a:(b!=x && b!=z)?b:c;

        int min = 0;
        int max = (z-y-1)+(y-x-1);

        if(z-y==1 && y-x==1)
            min = 0;
        else if((z-y==1 || y-x==1) || (z-y==2 || y-x==2))
            min = 1;
        else
            min = 2;
        return new int[] {min,max};
    }
}
```
['Java']