Short & Concise Sliding window | C++
\nclass Solution {\npublic:\n    int minSwaps(vector<int>& nums) {\n        int l = 0, s = 0, i = 0, ans = INT_MAX;\n        for(int i : nums) l += i;\n        
```\nclass Solution {\npublic:\n    int minSwaps(vector<int>& nums) {\n        int l = 0, s = 0, i = 0, ans = INT_MAX;\n        for(int i : nums) l += i;\n        nums.insert(nums.end(), nums.begin(), nums.end());\n        \n        for(int j=0; j<nums.size(); j++) {\n            s += nums[j];\n            if(j - i + 1 == l) {\n                ans = min(ans, l - s);\n                s -= nums[i++];\n            }\n        }\n        return ans == INT_MAX ? 0 : ans;\n    }\n};\n```
['Sliding Window', 'C++']