[PYTHON] easy to understand solution
Explanation:\n\n1. Count Brackets:\n    - For each [ in the string, we increment count.\n    - For each ], if there\'s an unbalanced [, we decrement count (indi
# Explanation:\n\n1. Count Brackets:\n    - For each `[` in the string, we increment count.\n    - For each `]`, if there\'s an unbalanced [, we decrement count (indicating a match).\n2. Calculate Minimum Swaps:\n    - The number of swaps required is half of the remaining unbalanced brackets. The formula `(count + 1) // 2` ensures that we round up if count is odd.\n\n# Approach\n1. Count the imbalance:\n\n    - Traverse the string and maintain a count of unbalanced opening brackets (`[`).\nFor each closing bracket (`]`), reduce the count if there is an unmatched opening bracket before it (i.e., a match can be made).\n    - The variable count will eventually hold the number of unbalanced opening brackets.\n\n2. Calculate the minimum swaps:\n\n    - To balance the string, half of the unmatched opening brackets need to be swapped with corresponding unmatched closing brackets.\n    - Thus, the minimum number of swaps is `(count + 1) // 2`.\n\n# Complexity\n- Time complexity: $O(N)$\n\n- Space complexity: $O(1)$\n\n# Code\n```python3 []\nclass Solution:\n    def minSwaps(self, s: str) -> int:\n        count = 0\n        for c in s:\n            if c == \'[\':\n                count += 1\n            elif count > 0:\n                count -= 1\n        return (count + 1) // 2\n```
['Python3']