C++ super easy and short 9-line solution, beats 100% time and 100% space!
```\n\tvector numMovesStonesII(vector& stones) {\n        int mx=INT_MAX, ct=0, size=stones.size(), pre=0;\n        sort(stones.begin(), stones.end());\n       
```\n\tvector<int> numMovesStonesII(vector<int>& stones) {\n        int mx=INT_MAX, ct=0, size=stones.size(), pre=0;\n        sort(stones.begin(), stones.end());\n        for(int i=0;i<stones.size();i++) {\n            while(stones[i]-stones[pre]>size-1) pre++;\n            ct=max(ct, i-pre+1);\n        }\n        mx=max(stones[size-2]-stones[0]-size+2, stones.back()-stones[1]-size+2);\n        if(stones.back()-stones[0]>size&&(stones[size-2]-stones[0]==size-2||stones[size-1]-stones[1]==size-2)) ct--;\n        return {size-ct, mx};\n    }
[]