To store the count of ith character of subString str [ 0. . . i ]
let dp = new Array ( 26 ) ; for ( let i = 0 ; i < 26 ; i ++ ) { dp [ i ] = new Array ( n ) ; for ( let j = 0 ; j < n ; j ++ ) dp [ i ] [ j ] = 0 ; } for ( let i = 0 ; i < 26 ; i ++ ) {