If current character is ' a ' , then there are the following possibilities : a ) Current character begins a new subsequence . b ) Current character is part of aCount subsequences . c ) Current character is not part of aCount subsequences .
if ( s [ i ] == ' a ' ) aCount = ( 1 + 2 * aCount ) ;