if ' _ ' can be swapped with the character at ' i + 2'
if ( pp < n - 2 && ss [ pp + 1 ] != ss [ pp + 2 ] ) { swap ( ss [ pp ] , ss [ pp + 2 ] ) ; if ( ! vis . count ( ss ) ) { if ( ss == f ) { return dist + 1 ; break ; } vis [ ss ] = dist + 1 ; q . push ( { ss , pp + 2 } ) ; } swap ( ss [ pp ] , ss [ pp + 2 ] ) ; } } }