If current characters at both ends are not fancy pairs
if ( ! fp . containsKey ( num . charAt ( l ) ) || fp . get ( num . charAt ( l ) ) != num . charAt ( r ) ) return false ; l ++ ; r -- ; } return true ; }