write an algorithm using stack to determine if an input of string is in the form xCy where y is the reverse of x.x and y are strings of A and B.
eg AABACABAA

please help me out!