Loop to count the occurrence of ith character before jth character in the given string
for ( int i = 0 ; i < n ; i ++ ) { int c = ( s [ i ] - ' a ' ) ; for ( int j = 0 ; j < 26 ; j ++ ) dp [ j ] += freq [ j ] ;