------
## 最终结论
```python
def swap_count(s):
    left = 0
    right = 0
    swaps = 0

    for char in s:
        if char == '[':
            left += 1
            if right > 0:
                swaps += right
                right -= 1
        else:
            right += 1
    
    return swaps

# Test cases
assert swap_count("[]][][") == 2
assert swap_count("[[][]]") == 0
assert swap_count("[[][]]][") == 1
```