initialize all elements of char_freq [ ] to 0
Arrays . fill ( char_freq , 0 ) ; int nv = 0 , nc = 0 ; String vstr = " " , cstr = " " ; int l = str . length ( ) ; for ( int i = 0 ; i < l ; i ++ ) { char ch = str . charAt ( i ) ;