C++||Sliding Window|| Easy to Understand
\nclass Solution {\npublic:\n    vector<int> numMovesStonesII(vector<int>& stones) \n    {\n        sort(stones.begin(),stones.end());\n        int n=stones.siz
```\nclass Solution {\npublic:\n    vector<int> numMovesStonesII(vector<int>& stones) \n    {\n        sort(stones.begin(),stones.end());\n        int n=stones.size();\n        int low=n;\n        for(int i=0,j=0;j<n;j++)\n        {\n            while(stones[j]-stones[i]+1>n)\n                i++;\n            int already_store=j-i+1;\n            if(already_store==n-1&&(stones[j]-stones[i]+1==n-1))\n            {\n                low=min(low,2);\n            }\n            else\n            {\n                low=min(low,n-already_store);\n            }\n        }\n        return {low,max(stones[n-1]-stones[1]-n+1,stones[n-2]-stones[0]-n+1)+1};\n        \n    }\n};\n```\nIf you like the solution plz upvote.
['C', 'Sorting']