If hashmaps are found to be identical for any substring
for ( var i = 0 ; i < 26 ; i ++ ) { if ( s1hash [ i ] != s2hash [ i ] ) { ans = false ; } } if ( ans ) return true ; right ++ ; if ( right != s2len ) s2hash [ s2 [ right ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] += 1 ; s2hash [ s2 [ left ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] -= 1 ; left ++ ; } return false ; }