You are given a binary string s consisting only of the characters '0' and '1'.
You may choose to swap any two characters in s at most once.
A substring of s is called balanced if the count of '0' characters is equal to the count of '1' characters within that substring.
Return the maximum possible length of a balanced substring that can be formed after at most one swap.
Constraints:
s.length
s consists only of the characters '0' and '1'.
You are given a binary string s consisting only of the characters '0' and '1'.
You may choose to swap any two characters in s at most once.
A substring of s is called balanced if the count of '0' characters is equal to the count of '1' characters within that substring.
Return the maximum possible length of a balanced substring that can be formed after at most one swap.
Constraints:
s.length
s consists only of the characters '0' and '1'.