This loop inserts the remaining characters in the encoded string .
for ( let i = 0 ; i < 26 ; i ++ ) { if ( arr [ i ] == false ) { arr [ i ] = true ; encoded += String . fromCharCode ( i + 65 ) ; } } return encoded ; }