dp [ i ] [ j ] stores the count of subsequence with ' a ' + i and ' a ' + j character
ll dp [ 26 ] [ 26 ] ; memset ( freq , 0 , sizeof freq ) ; memset ( dp , 0 , sizeof dp ) ; for ( int i = 0 ; i < s . size ( ) ; ++ i ) { for ( int j = 0 ; j < 26 ; j ++ ) {