Python sliding window solution
\ndef minSwaps(self, nums: List[int]) -> int:\n\tk, n = sum(nums), len(nums)\n\ts, mx = sum(nums[:k]), 0\n\tfor i in range(k, 2*n):\n\t\ts += (nums[i%n]-nums[i%
```\ndef minSwaps(self, nums: List[int]) -> int:\n\tk, n = sum(nums), len(nums)\n\ts, mx = sum(nums[:k]), 0\n\tfor i in range(k, 2*n):\n\t\ts += (nums[i%n]-nums[i%n-k])\n\t\tmx = max(s, mx)\n\treturn k-mx\n```
[]