Sliding Window || Fixed Size || C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int minSwaps(vector<int>& nums) {\n        \n         int one=0;\n         for(auto& x: nums)\n          if(x==1)\n           one++;\n        if(one<=1)\n         return 0;\n        vector<int> a=nums;\n        for(auto& x:nums)\n        {\n            a.push_back(x);\n        }\n        int n=a.size();\n        int ans=n;\n        int i=0,j=0;\n        int count=0;\n        for(;j<n;j++)\n        {\n             if(a[j]==0)\n              count++;\n            while(i<j && (j-i+1)>one)\n            {\n                if(a[i]==0)\n                 count--;\n                i++;    \n            }\n            if((j-i+1)==one)\n             ans=min(ans,count);\n        }\n\n        return ans;\n    }\n};\n```
['Sliding Window', 'C++']