Question 857603
Hint: Your states will be True or False depending on whether the string satisfies the constraints. Define two counters (e.g. numA and numB) that count the number of A's and number of B's. When numA % 2 = 0 or numB = 0 or numB >= 2, the current state will be False, and when numA % 2 = 1 and numB = 1, the state will be true.