1653. Minimum Deletions to Make String Balanced
## 思路
Minimum Deletions = 把所有的ba配對刪掉的次數
for迴圈掃整個字串
如果遇到a 且Stack最後是b 就pop掉 並且 ans+1
否然就把該字元加進Stack
## Complexity
Time, Space: O(N)
## Code
```python
class Solution:
def minimumDeletions(self, s: str) -> int:
n = len(s)
ans = 0
stack = []
for ch in s:
if stack and stack[-1] == 'b' and ch == 'a':
stack.pop()
ans += 1
else:
stack.append(ch)
return ans
```