Given a string s consisting of characters 'a' and 'b'.
In one operation, you can select any contiguous substring of s that contains an equal number of 'a' and 'b' characters and delete it. The remaining left and right segments are then concatenated together.
Return the minimum possible length of s after performing any number of such operations.
Constraints:
s.length
s[i] is either 'a' or 'b'.
Given a string s consisting of characters 'a' and 'b'.
In one operation, you can select any contiguous substring of s that contains an equal number of 'a' and 'b' characters and delete it. The remaining left and right segments are then concatenated together.
Return the minimum possible length of s after performing any number of such operations.
Constraints:
s.length
s[i] is either 'a' or 'b'.