Given a sequence of two letters A and B find the total number of possible sub sequences where number of letter A is two times the number of letter B
without changing the order.
For example consider the sequence
AAAABBAAAA Now the possible sub sequences with given conditions can be
Some insights on how to approach this problem would be great, with or without the solution. Also, I often come across these kind of problems where there's a bunch of permutations involved and you've to try them all to figure out the solution. Is there any specific approach for such questions? Any book you can recommend which can help me get better at solving such problem?