Easy & Short C++
\nclass Solution {\npublic:\n    int minSwaps(vector<int>& nums) {\n        int ones = 0;\n        for(int x: nums){\n            if(x) ones++;\n        }\n    
```\nclass Solution {\npublic:\n    int minSwaps(vector<int>& nums) {\n        int ones = 0;\n        for(int x: nums){\n            if(x) ones++;\n        }\n        int m = 0;\n        for(int i=0;i<ones;i++){\n            if(nums[i]) m++;\n        }\n        int mx = m;\n        for(int i=1;i<nums.size();i++){\n            if(nums[i-1]) m--;\n            if(nums[(i-1+ones)%nums.size()]) m++;\n            mx = max(mx, m);\n        }\n        return ones-mx;\n    }\n};\n```
['C']