You are given a string s consisting only of the characters 'a' and 'b'.
In a single operation, you can remove any palindromic subsequence from s.
Return the minimum number of operations required to make s completely empty.
Note: A subsequence is derived from a string by deleting
or more characters without altering the relative order of the remaining characters. A string is considered a palindrome if it reads identically from left to right and from right to left.
Constraints:
s.length
s[i] is either 'a' or 'b'.
You are given a string s consisting only of the characters 'a' and 'b'.
In a single operation, you can remove any palindromic subsequence from s.
Return the minimum number of operations required to make s completely empty.
Note: A subsequence is derived from a string by deleting
or more characters without altering the relative order of the remaining characters. A string is considered a palindrome if it reads identically from left to right and from right to left.
Constraints:
s.length
s[i] is either 'a' or 'b'.