DAY75 || ABHINAV
Intuition\n Describe your first thoughts on how to solve this problem. \n1. Sort the stones to make it easier to analyze the positions. Find the minimum number 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n1. Sort the stones to make it easier to analyze the positions. Find the minimum number of moves required to make the stones consecutive by iterating through the sorted list of stones.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. Sort the stones to make it easier to analyze their positions.\n2. Determine the minimum number of moves required to make the stones consecutive by iterating through the sorted list of stones.\n3. Calculate the maximum number of moves required by considering the possibilities at both ends of the sorted list of stones.\n4. Return the minimum and maximum number of moves as a pair.\n\n# Complexity\n- Time complexity: O(NlogN)\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 {\npublic:\n    vector<int> numMovesStonesII(vector<int>& stones) {\n        sort(stones.begin(), stones.end());\n\n        int N = stones.size(), low = N;\n        for (int i = 0, j = 0; j < N; ++j) {\n            while (stones[j] - stones[i] + 1 > N) {\n                ++i;\n            }\n            if (N - (j - i + 1) == 1 && N - (stones[j] - stones[i] + 1) == 1) {\n                low = min(low, 2);\n            } \n            else {\n                low = min(low, N - (j - i + 1));\n            }\n        }\n\n        int high = 1 + max((stones[N - 1] - stones[1] + 1) - N,  (stones[N - 2] - stones[0] + 1) - N);\n        return {low, high};\n    }\n};\n```
['C++']