Increment count of current character If this count is one then a new distinct character is found in sliding window .
cnt [ str [ end ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ++ ; if ( cnt [ str [ end ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] == 1 ) distEle ++ ;