You are given a string s of length n consisting only of the characters 'A' and 'B', along with a queries.
There are two types of queries:
[1, j]: Flip the character s[j]. If s[j] is 'A', it becomes 'B', and if s[j] is 'B', it becomes 'A'.
[2, l, r]: Determine the minimum number of character deletions required to make the substring s[l..r] alternating.
A string is defined as alternating if no two adjacent characters are equal.
Return an integer array containing the results of all type
Constraints:
s.length
s[i] is either 'A' or 'B'.
queries.length
queries[i].length is equal to
queries[i] is either of the form [1, j] or [2, l, r].
You are given a string s of length n consisting only of the characters 'A' and 'B', along with a queries.
There are two types of queries:
[1, j]: Flip the character s[j]. If s[j] is 'A', it becomes 'B', and if s[j] is 'B', it becomes 'A'.
[2, l, r]: Determine the minimum number of character deletions required to make the substring s[l..r] alternating.
A string is defined as alternating if no two adjacent characters are equal.
Return an integer array containing the results of all type
Constraints:
s.length
s[i] is either 'A' or 'B'.
queries.length
queries[i].length is equal to
queries[i] is either of the form [1, j] or [2, l, r].