✅ [C++] Easy Code with inline Explaination. O(n)
\nint minSwaps(vector<int>& nums) {\n        int one=0,n=nums.size(),ans=INT_MAX;\n        for(int i=0;i<n;i++) if(nums[i]) one++;\n        int start=0,end=0,cn
```\nint minSwaps(vector<int>& nums) {\n        int one=0,n=nums.size(),ans=INT_MAX;\n        for(int i=0;i<n;i++) if(nums[i]) one++;\n        int start=0,end=0,cnt=0;         //cnt -> keep count of one\'s inside window //Window look like this [start ,,,....,,, end] \n        while(end<n+one){                  // check until window slide complete array + circular \n            if(nums[end%n])cnt++;          //update count of one\'s   // mod (%) to keep variable < size of array\n            if(one==(end-start+1)%n){      //if window size is equal to total one\'s\n                ans=min(ans,one-cnt);      // keep track of minimun\n                if(nums[start%n])cnt--;    //update count of one\'s \n                start++;                   //move window 1 step forword\n            }\n            end++;                         //move window 1 step forword\n        }\n        return ans==INT_MAX?0:ans;\n    }\n```\n\t\n\t**Upvote if you appreciate**
['C', 'Sliding Window', 'C++']