I'm trying to find an unambiguous context free language for the ambiguous language:
$$S\rightarrow AB$$ $$A\rightarrow Ba| b$$ $$B \rightarrow aA|b$$
I understand the language makes up of strings that have exactly 2 $b$'s and for each b on either side of each $b$ the language generates $a$'s in a balanced manner such that no side differs by a count of 1 $a$. (I hope that make sense). However, I can't think of a method to create a new grammar to make it unambiguous.
Thanks for any help.