You are given a string s and two integers x and y. You can perform two types of operations any number of times:
Remove any occurrence of the substring "ab" and gain x points.
Remove any occurrence of the substring "ba" and gain y points.
Return the maximum total points you can obtain after applying any number of these operations.
Constraints:
s.length
x, y
s consists of lowercase English letters.
You are given a string s and two integers x and y. You can perform two types of operations any number of times:
Remove any occurrence of the substring "ab" and gain x points.
Remove any occurrence of the substring "ba" and gain y points.
Return the maximum total points you can obtain after applying any number of these operations.
Constraints:
s.length
x, y
s consists of lowercase English letters.